Skip to content

Instantly share code, notes, and snippets.



Created Mar 12, 2016
What would you like to do?
public class ChangePricingLevelHandler : IAsyncRequestHandler<ChangeCustomerPricingLevel, Unit>
private CustomerContext _db;
public ChangePricingLevelHandler(CustomerContext db)
_db = db;
public async Task<Unit> Handle(ChangeCustomerPricingLevel message)
var customer = _db.Customers.Single(x => x.CustomerId == message.CustomerId);
customer.PrivingLevel = message.PricingLevel;
await _db.SaveChangesAsync();
return Unit.Value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment