c# - What Should a domain Model return when using an interface? -
i have got mvc application in domain model (data model + business model) resides in different class library. using interface exposing methods must return data not entire representation of domain objects. my question how should return data? should create kind of view models on business model layer , match them real view models on main application ( views-controllers-viewmodels )? should return data dynamic objects? should return entire domain object event need couple of properties only? best approach follow? this example give better idea situation: //domain class public class user { public string username { get; set; } public int userid { get; set; } public string userpassword{ get; set; } public string firstname{ get; set; } public virtual icollection<applicationuserteam> applicationuserteams { { return _applicationuserteams; } set { _applicationuserteams = value; } } } public interface itrackattendance { dynamic ge...