public async Task AssignCounterToBranch(AssignCounterToBranchViewModel request, CancellationToken cancellationToken = default) { var entity = await _context.Counters.FindAsync(request.CounterId); if (entity == null) { throw new NotFoundException(nameof(Counter), request.CounterId); } var mappedEntity = request.Map(entity); _context.Counters.Update(mappedEntity); await _context.SaveChangesAsync(cancellationToken); }
public async Task <ActionResult> AssignCounterToBranch([FromBody] AssignCounterToBranchViewModel request) { await _branchManagement.AssignCounterToBranch(request); return(Ok()); }