public async Task <IActionResult> Post(CheckinCreateViewModels viewModel) { if (this.ModelState.IsValid) { Checkin entity = viewModel.ToEntity(); var repo = this.Storage.GetRepository <ICheckinRepository>(); entity.VerifyLate(_configuration.GetValue <string>("LateTime")); var imageUrl = await _imageService.UploadImageAsync(viewModel.Image); entity.ImageUrl = imageUrl.ToString(); repo.Create(entity, GetCurrentUserName()); this.Storage.Save(); return(Ok(new { success = true })); } return(BadRequest(new { success = false })); }