public async Task EditAsync(ExecutorsCasesEditViewModel model) { var executorCase = new ExecutorCase { Id = model.Id, ExecutorId = model.ExecutorId, LawCaseId = model.LawCaseId, ExecutorCaseNumber = model.ExecutorCaseNumber, Year = model.Year, }; this.dbContext.Update(executorCase); await this.dbContext.SaveChangesAsync(); }
public async Task CreateAsync(ExecutorsCasesCreateViewModel model) { var executorsCase = new ExecutorCase { LawCaseId = model.LawCaseId, ExecutorId = model.ExecutorId, ExecutorCaseNumber = model.ExecutorCaseNumber, Year = model.Year, }; await this.dbContext.ExecutorCases.AddAsync(executorsCase); await this.dbContext.SaveChangesAsync(); }