public async Task UpdateBranch(UpdateBranchViewModel request, CancellationToken cancellationToken = default) { var entity = await _context.Branches.FindAsync(request.BranchId, request.BankId); if (entity == null) { throw new NotFoundException(nameof(Branch), new { request.BranchId, request.BankId }); } var mappedEntity = request.Map(entity); _context.Branches.Update(mappedEntity); await _context.SaveChangesAsync(cancellationToken); }
public async Task <ActionResult> UpdateBranch([FromBody] UpdateBranchViewModel request) { await _branchManagement.UpdateBranch(request); return(Ok()); }