示例#1
0
 public BreederStationDataLayer.Orm.Dto.Food mapDomainToDtoObject(Food food)
 {
     BreederStationDataLayer.Orm.Dto.Food dtoFood = new BreederStationDataLayer.Orm.Dto.Food
     {
         Id             = food.Id,
         Carbohydrates  = food.Carbohydrates,
         Fat            = food.Fat,
         Proteins       = food.Proteins,
         Price          = food.Price,
         Name           = food.Name,
         FoodRunningOut = food.FoodRunningOut,
         Company        = new BreederStationDataLayer.Orm.Dto.Company {
             Id = food.Company.Id, Trademark = food.Company.Trademark
         }
     };
     return(dtoFood);
 }
示例#2
0
        public Food mapDtoToDomainObject(BreederStationDataLayer.Orm.Dto.Food dtoFood)
        {
            Food food = new Food
            {
                Id             = dtoFood.Id,
                Carbohydrates  = dtoFood.Carbohydrates,
                Fat            = dtoFood.Fat,
                Proteins       = dtoFood.Proteins,
                Price          = dtoFood.Price,
                Name           = dtoFood.Name,
                FoodRunningOut = dtoFood.FoodRunningOut,
                Company        = new Company {
                    Id = dtoFood.Company.Id, Trademark = dtoFood.Company.Trademark
                }
            };

            return(food);
        }