Пример #1
0
        public Floor CreateFloor(CreateFloorModel model)
        {
            var entity = model.ToDest();

            PrepareCreate(entity);
            return(context.Floor.Add(entity).Entity);
        }
        public IActionResult Create(CreateFloorModel model)
        {
            var validationResult = _service.ValidateCreateFloor(User, model);

            if (!validationResult.Valid)
            {
                return(BadRequest(validationResult.Result));
            }
            var entity = _service.CreateFloor(model);

            context.SaveChanges();
            return(Created($"/{ApiEndpoint.FLOOR_API}?id={entity.Id}",
                           new AppResultBuilder().Success(entity.Id)));
        }
Пример #3
0
 public ValidationResult ValidateCreateFloor(ClaimsPrincipal principal,
                                             CreateFloorModel model)
 {
     return(ValidationResult.Pass());
 }