Updating the admin website

As with the order processor, we can do a small modification to the admin website to call the Notification/PostProductNews action when a new product is created, which will send push notifications to all customers. The procedure for this is pretty much the same, but here, I created a separate helper class to separate the logic from the controller:

private readonly MobileServiceClient _mobileService; public Notifications() { var mobileServiceUrl = ConfigurationManager.AppSettings["mobileServiceUrl"]; var mobileServiceKey = ConfigurationManager.AppSettings["mobileServiceKey"]; this._mobileService = new MobileServiceClient(mobileServiceUrl, mobileServiceKey); } public async Task NotifyPostProductNews(int productId) { dynamic ...

Get Learning Microsoft Azure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.