public async Task <bool> CreateRAMPart(RAMServiceModel rAMServiceModel) { RAM rAMEntity = rAMServiceModel.To <RAM>(); rAMEntity.Id = Guid.NewGuid().ToString(); bool result = await this.pCCDbContext.AddAsync(rAMEntity) != null; await this.pCCDbContext.SaveChangesAsync(); return(result); }
public async Task <IActionResult> CreateRAM(CreateRAMBindingModel createRAMBindingModel) { RAMServiceModel serviceModel = createRAMBindingModel.To <RAMServiceModel>(); string url = await this.cloudinaryService.UploadImage(createRAMBindingModel.FileUpload); serviceModel.ImageUrl = url; bool result = await this.partsService.CreateRAMPart(serviceModel); return(Redirect("/")); }