示例#1
0
 public async Task <IActionResult> CreateSketch([FromForm] CreateUpdateSketchViewModel viewModel)
 {
     return(await Validation_EmailConfirmation_ModelState(User, ModelState, async (user) => {
         viewModel.UserId = user.Id;
         viewModel.Extension = Path.GetExtension(viewModel.File.FileName);
         var sketch = postBehaviour.CreateSketch(viewModel.AsSketch());
         var extension = await photoManager.SaveSketchPhoto($"{sketch.Id}", viewModel.File);
         if (extension == null)
         {
             return Conflict("Could not save File.");
         }
         return Ok(sketch);
     }));
 }