क्या निम्नलिखित करना ठीक है? मुझे पता है कि डोमेन मॉडल का कभी भी विचारों में उपयोग नहीं किया जाना चाहिए, लेकिन क्या आपके व्यू मॉडल में डोमेन मॉडल का उपयोग करना ठीक है? कुछ बहुत छोटे मॉडल के लिए यह उनके लिए एक व्यू मॉडल बनाने और प्रबंधित करने के लायक नहीं लगता है।एमवीसी देखें मॉडल में डोमेन मॉडल का उपयोग
उदाहरण
लिएpublic class LoginDomainModel
{
public string Email { get; set; }
public string Password { get; set; }
public string DisplayName { get; set; }
public long UserTypeID { get; set; }
public virtual UserType UserType { get; set; }
}
public class UserTypeDomainModel
{
public UserType()
{
this.Logins = new List<Login>();
}
public long UserTypeID { get; set; }
public string UserType { get; set; }
public string Description { get; set; }
public virtual ICollection<Login> Logins { get; set; }
}
public class LoginViewModel
{
public string Email { get; set; }
public long UserTypeID {get; set;}
//Right here
public List<UserTypeDomainModel> UserTypesSelectList {get; set;}
}
सभी महान उत्तरों, सभी को धन्यवाद। – Preston