コード例 #1
0
 public DishType DTFromPOCO(DishTypeDto type)
 {
     return(new DishType()
     {
         ID = type.ID, Description = type.Description, Name = type.Name
     });
 }
コード例 #2
0
 public DishType DTNewFromPOCO(DishTypeDto type)
 {
     return(new DishType()
     {
         Description = type.Description, Name = type.Name, Dishes = new List <Dish>()
     });
 }
コード例 #3
0
        public void AddDishType(DishTypeDto dishType)
        {
            var disshType = new DishType {
                Id = dishType.TypeId, Description = dishType.Description
            };

            _dishTypeRepository.Add(disshType);
        }
コード例 #4
0
 public ActionResult AddDishType(string dishTypeName)
 {
     try
     {
         var dishTypeDto = new DishTypeDto()
         {
             Name = dishTypeName, Description = dishTypeName
         };
         dishService.CreateNewDishType(dishTypeDto);
         return(RedirectToAction("AddDish"));
     }
     catch (Exception exception)
     {
         return(new HttpStatusCodeResult(500));
     }
 }
コード例 #5
0
 public void Insert(DishTypeDto dishType)
 {
     _platService.AddDishType(dishType);
 }