public async Task DestroyMoment (Moment moment) { using (var handler = new ZumoAuthHeaderHandler ()) { using (var client = MobileServiceClientFactory.CreateClient (handler)) { await client.GetTable<Moment> ().DeleteAsync (moment); } } }
private async Task SendImageToUsers (string imageUrl, List<User> recipients, int displayTime) { using (var handler = new ZumoAuthHeaderHandler ()) { using (var client = MobileServiceClientFactory.CreateClient (handler)) { var senderUserId = AccountService.Instance.User.Id; var senderProfileImage = AccountService.Instance.User.ProfileImage; var senderName = AccountService.Instance.User.Name; var timeSent = DateTime.UtcNow; foreach (var user in recipients) { var recipientUserId = user.Id; var moment = new Moment { MomentUrl = imageUrl, SenderUserId = senderUserId, SenderName = senderName, SenderProfileImage = senderProfileImage, RecipientUserId = recipientUserId, DisplayTime = displayTime, TimeSent = timeSent }; Xamarin.Insights.Track ("MomentShared"); await client.GetTable<Moment> ().InsertAsync (moment); } } } }
private async Task DestroyImage (Moment moment) { Moments.Remove (moment); await MomentService.Instance.DestroyMoment (moment); }
private async Task DestroyImage(Moment moment) { Moments.Remove(moment); await MomentService.Instance.DestroyMoment(moment); }