我有两个班级
public class LoginModel : IBaseInterface
{
public string EmailAddress { get; set; }
public string Password { get; set; }
}
和
public class UsersModel : IBaseInterface
{
public int UserID { get; set; }
public string UserName { get; set; }
public string EmailAddress { get; set; }
public int RoleID { get; set; }
public string RoleName { get; set; }
public int ProjectID { get; set; }
public string ProjectName { get; set; }
public int PMID { get; set; }
public string PMEmailAddress { get; set; }
public string PMEmailName { get; set; }
public int DMID { get; set; }
public string DMEmailAddress { get; set; }
public string DMEmailName { get; set; }
}
IBaseInterface是一个界限,没有任何定义。
public static IBaseInterface Create(ObjectsCollection Type)
{
switch (Type)
{
default:
return null;
case ObjectsCollection.UsersModel:
return new UsersModel();
case ObjectsCollection.LoginModel:
return new LoginModel();
}
}
一切都很好用于物体。但是如何使用此工厂返回List<UsersModel>
和List<LoginModel>
如果有人请帮我解决这个问题会很好。
由于