public async Task CreateRealtimeSub(SubscriptionResponse response, CreateSub create, string user) { var rt = new RealtimeSubscription(); rt.Type = create.Type; rt.UserId = user; rt.Object_Id = response.Data.Object_Id; rt.LastMediaIdRequest = "0"; rt.Tag = create.Tag; rt.Latitude = create.Latitude; rt.Longitude = create.Longitude; await _tableSet.AddOrUpdateAsync(rt); }
public async Task<IHttpActionResult> Post(CreateSub sub) { SubscriptionResponse response; if(sub.Type == "place") { response = await _subscriptionEndpoint.CreateGeographySubscription(sub.Latitude, sub.Longitude, sub.Radius); } else { response = await _subscriptionEndpoint.CreateTagSubscription(sub.Tag); } _log.Information("Subscription {0} created: {1} id: {2}", response.Data.Id, response.Data.Object, response.Data.Object_Id); await _subscriptions.CreateRealtimeSub(response, sub, User.Identity.Name); return Ok(response.Data); }