public async Task <ActionResult <ZIFile> > Post([FromBody] ZIFile file) { this._repo.SaveBytesToFileSystem(file); file.Id = Guid.NewGuid().ToString("N"); await _repo.Create(file); return(new OkObjectResult(file)); }
public async Task <ActionResult <ZIFile> > Put(String id, [FromBody] ZIFile file) { var fileFromDb = await _repo.Get(id); if (fileFromDb == null) { return(new NotFoundResult()); } file.Id = fileFromDb.Id; file.InternalId = fileFromDb.InternalId; file.Path = fileFromDb.Path; await _repo.Update(file); return(new OkObjectResult(file)); }