public async Task <IHttpActionResult> AddHiveSection([FromBody] UpdateHiveSectionRequest createRequest) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } HiveSection section = await _hiveSectionService.CreateHiveSectionAsync(createRequest); string location = $"/api/sections/{section.Id}"; return(Created(location, section)); }
public async Task <IHttpActionResult> AddHiveSection([FromBody] UpdateHiveSectionRequest createRequest) { IHttpActionResult result = CheckRequest(createRequest); if (result != null) { return(result); } HiveSection hiveSection = await _hiveSectionService.CreateHiveSectionAsync(createRequest); string location = $"/api/sections/{hiveSection.Id}"; return(Created <HiveSection>(location, hiveSection)); }