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))); }
public ValidationResult ValidateCreateFloor(ClaimsPrincipal principal, CreateFloorModel model) { return(ValidationResult.Pass()); }