草庐IT

AccountTypes

全部标签

c# - XML 字符串数组反序列化为不同的类型名称

我有以下C#类属性:privateList_accountTypes;[XmlArray(ElementName="accountTypes")]publicListAccountTypes{get{return_accountTypes;}set{_accountTypes=value;}}在类构造函数中是这样初始化的:_accountTypes=newList(newstring[]{"OHGEE","OHMY","GOLLY","GOLLYGEE"});当反序列化时我得到这个:OHGEEOHMYGOLLYGOLLYGEE如果我能得到这个我会喜欢的:OHGEEOHMYGOLLYGO

c# - 在 MVC 类上创建主键字段

我是MVC和C#的新手。我只是偶然发现它并发现它很有趣。我遇到了一个不允许我继续的问题。这是我的代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;namespaceMyHotel.Models{publicclassAccountTypes{publicintAccountTypeID{get;set;}publicstringAccountTypeName{get;set;}}}我随后创建了Controller和View。为此,我一直收