我有这一类:
public class Account
{
public int AccountID { get; set; }
public Enterprise Enterprise { get; set; }
public List<User> UserList { get; set; }
}
当我使用自动交换机绘制账户类别地图时,我也希望它绘制企业类别图,并绘制返回物体的用户名单。 我怎么能让自治者这样做?
感谢!
我有这一类:
public class Account
{
public int AccountID { get; set; }
public Enterprise Enterprise { get; set; }
public List<User> UserList { get; set; }
}
当我使用自动交换机绘制账户类别地图时,我也希望它绘制企业类别图,并绘制返回物体的用户名单。 我怎么能让自治者这样做?
感谢!
如果能为企业和用户类别提供配置,则自动交换机在箱子之外这样做。
结构如此:
Mapper.CreateMap<Account, AccountDto>();
Mapper.CreateMap<Enterprise, EnterpriseDto>();
Mapper.CreateMap<User, UserDto>();
This shows how to how collections get mapped: http://automapper.codeplex.com/wikipage?title=Lists%20and%20Arrays&referringTitle=Home
你们需要为你们所希望绘制的几端绘制地图。
Mapper.CreateMap<Account, AccountDto>();
Mapper.CreateMap<Enterprise, EnterpriseDto>();
Mapper.CreateMap<User, UserDto>();
命令并不重要。
I m trying to map CustomerDTO with my domain entity ICustomer with AutoMapper. Everything works fine for first inheritance level but not for the others. I m using Interfaces for my domain model since ...
I am configuring Automapper in the Bootstrapper and I call the Bootstrap() in the Application_Start(), and I ve been told that this is wrong because I have to modify my Bootstrapper class each time I ...
I have a simple model like this one: public class Order{ public int Id { get; set; } ... ... public IList<OrderLine> OrderLines { get; set; } } public class OrderLine{ public int ...
UPDATE: this stuff has evolved into a nice project, see it at http://valueinjecter.codeplex.com check this out, I just wrote a simple automapper, it takes the value from the property with the same ...
I have the following hook in my Global.aspx protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); AutoMapper....
Here s the deal: I have a report designer where users can create reports based on some predefined datasets. They can select a set of columns to include in the report and then, when the report is ran, ...
I am trying to use AutoMapper with web application running on IIS 7. The intended use it so map domain types defined in an external dll to view models defined in the IIS application. This works fine ...
let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...