Created
March 12, 2016 20:12
-
-
Save dcomartin/68adb70c0f1f26a4813f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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