public DalComponent MapToDal(BllComponent entity) { return(new DalComponent { Id = entity.Id, Name = entity.Name, Pressmark = entity.Pressmark, Template_id = entity.Template != null ? entity.Template.Id : (int?)null, IndustrialObject_id = entity.IndustrialObject != null ? entity.IndustrialObject.Id : (int?)null }); }
public BllComponent MapToBll(DalComponent entity) { BllComponent bllEntity = new BllComponent { Id = entity.Id, Name = entity.Name, Pressmark = entity.Pressmark, Template = entity.Template_id != null?templateService.Get((int)entity.Template_id) : null, IndustrialObject = entity.IndustrialObject_id != null?industrialObjectService.Get((int)entity.IndustrialObject_id) : null }; return(bllEntity); }