public async Task <DTOclaimuploaddocument> Postclaimuploaddocument(DTOclaimuploaddocument newDTO) { claimuploaddocument newProd = EntityMapper.updateEntity(null, newDTO); db.claimuploaddocuments.Add(newProd); await db.SaveChangesAsync(); return(newDTO); }
public async Task <DTOclaimuploaddocument> Postclaimuploaddocument(int userID, int activeProductItemsID, string claimUploadDocPath, int claimID) { claimuploaddocument newProd = createClaimUploadDocumentEntity(userID, activeProductItemsID, claimUploadDocPath, claimID); DTOclaimuploaddocument newDTO = new DTOclaimuploaddocument(newProd); db.claimuploaddocuments.Add(newProd); await db.SaveChangesAsync(); return(newDTO); }
public async Task <IHttpActionResult> Putclaimuploaddocument(int ID, DTOclaimuploaddocument editedDTO) { claimuploaddocument toUpdate = db.claimuploaddocuments.Find(ID); toUpdate = EntityMapper.updateEntity(toUpdate, editedDTO); db.Entry(toUpdate).State = EntityState.Modified; await db.SaveChangesAsync(); return(StatusCode(HttpStatusCode.NoContent)); }
private claimuploaddocument createClaimUploadDocumentEntity(int userID, int activeProductItemsID, string claimUploadDocPath, int claimID) { claimuploaddocument doc = new claimuploaddocument(); doc.User_ID = userID; doc.ActiveProductItems_ID = activeProductItemsID; doc.claimUploadDocumentPath = claimUploadDocPath; doc.Claim_ID = claimID; return(doc); }
public static claimuploaddocument updateEntity(claimuploaddocument entityObjct, DTOclaimuploaddocument dto) { if (entityObjct == null) { entityObjct = new claimuploaddocument(); } entityObjct.claimUploadDocument_ID = dto.claimUploadDocument_ID; entityObjct.User_ID = dto.User_ID; entityObjct.ActiveProductItems_ID = dto.ActiveProductItems_ID; entityObjct.document_ID = dto.document_ID; entityObjct.claimUploadDocumentPath = dto.claimUploadDocumentPath; entityObjct.Claim_ID = dto.Claim_ID; return(entityObjct); }