public virtual void Delete(TEntity entityToDelete) { if (contextdb.Entry(entityToDelete).State == EntityState.Detached) { dbSet.Attach(entityToDelete); } dbSet.Remove(entityToDelete); }
public async Task <int> UpdateCompany(Company company) { Company existingCompany = await FetchbyCompanyId(company.CompanyId); db.Entry(existingCompany).State = EntityState.Detached; db.Entry(company).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateGroup(Group group) { Group existingGroup = await FetchbyGroupId(group.GroupId); db.Entry(existingGroup).State = EntityState.Detached; db.Entry(group).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateMOM(MOM mom) { MOM existingMOM = await FetchbyMOMId(mom.MOMId); db.Entry(existingMOM).State = EntityState.Detached; db.Entry(existingMOM).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateClientDetail(ClientDetail clientdetail) { ClientDetail existingclientdetail = await FetchbyClientId(clientdetail.ClientID); db.Entry(existingclientdetail).State = EntityState.Detached; db.Entry(clientdetail).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateMasterDocument(DocumentMaster documentmaster) { DocumentMaster document = await GetMasterDocumentByID(documentmaster.DocumentMasterId); db.Entry(document).State = EntityState.Detached; db.Entry(document).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateAgency(Agency agency) { Agency existingAgency = await FetchbyAgencyId(agency.AgencyId); db.Entry(existingAgency).State = EntityState.Detached; db.Entry(agency).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateStrategyProposal(StrategyProposal StrategyProposal) { StrategyProposal existingStrategyProposal = await FetchbyStrategyProposalId(StrategyProposal.StrategyProposalId); db.Entry(existingStrategyProposal).State = EntityState.Detached; db.Entry(StrategyProposal).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateLender(Lender Lender) { Lender existingLender = await FetchbyLenderId(Lender.LenderId); db.Entry(existingLender).State = EntityState.Detached; db.Entry(Lender).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateReply(Reply reply) { Reply existingreply = await FetchbyReplyId(reply.ReplyId); db.Entry(existingreply).State = EntityState.Detached; db.Entry(reply).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateProjectActivityPlan(ProjectActivityPlan projectactivityplan) { ProjectActivityPlan existingProjectActivityplan = await FetchbyDocumentById(projectactivityplan.ProjectActivityPlanID); db.Entry(existingProjectActivityplan).State = EntityState.Detached; db.Entry(projectactivityplan).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateQuery(Query query) { Query existingquery = await FetchbyQueryId(query.QueryId); db.Entry(existingquery).State = EntityState.Detached; db.Entry(query).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateProject(Project project) { Project existingProject = await FetchbyProjectId(project.ProjectId); db.Entry(existingProject).State = EntityState.Detached; db.Entry(project).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateTaskTracker(TaskTracker tasktracker) { TaskTracker existingtasktracker = await FetchbyDocumentById(tasktracker.TaskTrackerID); db.Entry(existingtasktracker).State = EntityState.Detached; db.Entry(tasktracker).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateShareholder(Shareholder Shareholder) { Shareholder existingShareholder = await FetchbyShareholderId(Shareholder.ShareholderId); db.Entry(existingShareholder).State = EntityState.Detached; db.Entry(Shareholder).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateDirector(Director Director) { Director existingDirector = await FetchbyDirectorId(Director.DirectorId); db.Entry(existingDirector).State = EntityState.Detached; db.Entry(Director).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateCostBreakup(CostBreakup CostBreakup) { CostBreakup existingCostBreakup = await FetchbyCostBreakupId(CostBreakup.CBID); db.Entry(existingCostBreakup).State = EntityState.Detached; db.Entry(CostBreakup).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateAuthorisedPerson(AuthorisedPerson AuthorisedPerson) { AuthorisedPerson existingAuthorisedPerson = await FetchbyAuthorisedPersonId(AuthorisedPerson.AuthorisedPersonId); db.Entry(existingAuthorisedPerson).State = EntityState.Detached; db.Entry(AuthorisedPerson).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateDocument(Document document) { Document existingDocument = await FetchbyDocumentById(document.DocumentID); db.Entry(existingDocument).State = EntityState.Detached; db.Entry(document).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdatePromoter(Promoter Promoter) { Promoter existingPromoter = await FetchbyPromoterId(Promoter.PromoterId); db.Entry(existingPromoter).State = EntityState.Detached; db.Entry(Promoter).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateCustomer(Customer customer) { Customer existingcustomer = await FetchbyCustomerId(customer.CustomerId); db.Entry(existingcustomer).State = EntityState.Detached; db.Entry(customer).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateTeaser(Teaser Teaser) { Teaser existingTeaser = await FetchbyTeaserId(Teaser.TeaserId); db.Entry(existingTeaser).State = EntityState.Detached; db.Entry(Teaser).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }
public async Task <int> UpdateQueryRefDocument(QueryRefDocument queryrefdocument) { QueryRefDocument existingqueryrefdocument = await FetchbyQueryRefDocumentId(queryrefdocument.QueryRefDocumentID); db.Entry(existingqueryrefdocument).State = EntityState.Detached; db.Entry(queryrefdocument).State = EntityState.Modified; int result = await db.SaveChangesAsync(); return(result); }