public async Task <IActionResult> CreateDevice(DeviceViewModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await locationService.CreateDevice("", Mapper.Map <DeviceDto>(model)); return(Ok(result)); }