Exemplo n.º 1
0
        public IActionResult CreateStorageArea(Guid siteId, [FromBody] StorageAreaCreationRequest storageAreaCreationRequest)
        {
            if (storageAreaCreationRequest == null ||
                string.IsNullOrWhiteSpace(storageAreaCreationRequest.Name))
            {
                return(HandleBadRequest("A valid storage area name has to be supplied."));
            }

            StorageArea area = LocationsService.AddAreaToStorageSite(siteId, storageAreaCreationRequest.Name);

            return(Created(GetNewResourceUri(area.Id), area));
        }