public async Task <string> udpateProject(ProjectDto project, String projectid) { Project dto = await _context.Projects.FindAsync(projectid); dto.ProjectName = project.ProjectName; _context.Entry(dto).State = EntityState.Modified; await _context.SaveChangesAsync(); return(dto.CompanyId); }
public async Task <bool> DeleteAsset(string asssetID) { var asset = await _context.SliceAssets.FindAsync(asssetID); if (asset == null) { return(false); } try { asset.AssetStatus = Status.INACTIVE; _context.Entry(asset).State = EntityState.Modified; await _context.SaveChangesAsync(); return(true); } catch (DbUpdateException) { throw; } }
public async Task <string> UpdateCompany(string id, CompanyDetailDto company) { Company dto = await _context.Companies.FindAsync(id); dto.CompanyName = company.CompanyName; dto.ComapnyIcon = company.ComapnyIcon; dto.NonCashMultiplier = company.NonCashMultiplier; dto.CashMultiplier = company.CashMultiplier; dto.CashPerSlice = company.CashPerSlice; _context.Entry(dto).State = EntityState.Modified; await _context.SaveChangesAsync(); return(dto.CompanyId); }