public HttpResponseMessage Add([FromBody] AddFurnitureDto furnitureDto)
 {
     return(Request.ExecuteProtectedAndWrapResult <AddFurnitureDto, FurnitureItemModel>(
                dto => FurnitureService.RegisterFurnitureItem(dto),
                ModelState, furnitureDto
                ));
 }
Пример #2
0
 public FurnitureItemModel RegisterFurnitureItem(AddFurnitureDto dto)
 {
     return(ProtectedExecute <AddFurnitureDto, FurnitureItemModel>(furnitureDto =>
     {
         AdminService.CheckActiveAdmin(furnitureDto.AdminSession);
         FurnitureItemModel model = Mapper.Map <AddFurnitureDto, FurnitureItemModel>(furnitureDto);
         return FurnitureRepo.Create(model);
     }, dto));
 }