public async Task <Unit> Handle(Request request, CancellationToken cancellationToken) { var customer = await _context.LoadAsync <Customer>(request.CustomerId); customer.Reomve(_dateTime.UtcNow); await _context.SaveChangesAsync(cancellationToken); return(new()); }
public async Task <Response> Handle(Request request, CancellationToken cancellationToken) { var customer = await _context.LoadAsync <Customer>(request.Customer.CustomerId); customer.Update( request.Customer.Firstname, request.Customer.Lastname, request.Customer.Email, request.Customer.PhoneNumber); await _context.SaveChangesAsync(cancellationToken); return(new(customer.ToDto())); }