I need help with mapping entities. I want connect DAL and BL. I don´t know how to map collection.
Entity Team in DAL:
namespace ICSapp.DAL.Entities
{
public class Team : ICSappEntityBase
{
public string TeamName { get; set; }
public virtual ICollection<UserTeam> Members { get; set; }
public virtual ICollection<Post> Posts { get; set; }
}
Same class Is in my BLL models.
and here Is a code for BLL mapper:
namespace ICSapp.BL.Mapper
{
public static TeamModel MapTeamEntityToDTeamModel(Team entity)
{
return new TeamModel
{
Id = entity.Id,
TeamName = entity.TeamName,
// Members = entity.Members ??
// Posts = entity.Posts ??
};
}
public static Team MapTeamModelToTeamEntity(TeamModel model)
{
return new IngredientEntity
{
Id = model.Id,
TeamName = model.TeamName,
//Members = model.Members ??
// Posts = model Posts ??
};
}
}
So how to map a collection? Thanks
PS : I need to do it manually.