Hi All / very new to Auto-Mapper. i can map one to one objects but was wondering is it possible to map multiple objects to one object or multiple objects to multiple objects?
consider i have a following scenario...
User Model
public class User
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Company Company { get; set; } // 1 user work in 1 company
}
Company Model
public class Company
{
public string CompanyName { get; set; }
public string Website { get; set; }
public ICollection<User> Users { get; set; } // 1 Company can have many users
}
UserCompanyViewModel
i want to show List of users with their company details in one view..
public class UserCompanyViewModel
{
public ICollection<User> Users { get; set; }
ppublic ICollection<Company> Companies { get; set; }
}
Now, is it possible to map in this situation and if yes, i can show in one view and when editing that view i want to map again with the updated fields back to their respective Models.
any help would be appreciated...thx