c# - How to use domain model relations in viewmodel? -
i'm using viewmodel in order separate domain model data presentation, can't how use database table relations exist in domain model. example domain model class how should used in viewmodel? in exanple currencydictionary table foreign key settings table.
public partial class settings { public int id { get; set; } ...list of properties... public int shopcurrency { get; set; } public ienumerable<selectlistitem> currencylist { get; set; } public virtual currencydictionary currencydictionary { get; set; } }
you'd have corresponding view model given domain model related, settings
view model contain corresponding currencydictionary
view model, like:
public class settingsmodel { public currencydictionarymodel currencydictionary { get; set; } }
Comments
Post a Comment