Exemplo n.º 1
0
 /// <summary>
 /// Provide details about a particular subscription i.e. description etc.
 /// </summary>
 /// <param name="subscriptionName">Name of the subscription to search.</param>
 /// <returns>Returns the subscripton details (name, description).</returns>
 public SubscriptionInfoDataModel SelectBySubscription(string subscriptionName)
 {
     try
     {
         SubscriptionInfoDataModel sidm = this.serviceContext.SubscriptionsInfoTable.Where(s => (s.SubscriptionName == subscriptionName)).FirstOrDefault();
         return(sidm);
     }
     catch (DataServiceQueryException)
     {
         return(null);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Delete a subscription from the system. Higher level should clean up subscriptions in the system, i.e. remove devices from the subscription
 /// </summary>
 /// <param name="item">Subscription info record to be deleted.</param>
 public void Delete(SubscriptionInfoDataModel item)
 {
     this.serviceContext.DeleteObject(item);
     this.serviceContext.SaveChanges();
 }
Exemplo n.º 3
0
        // CRUD operations below

        /// <summary>
        /// Used to create / insert a new subscription.
        /// </summary>
        /// <param name="newItem">Subscription info record to be inserted.</param>
        public void Insert(SubscriptionInfoDataModel newItem)
        {
            this.serviceContext.AddObject(MessageServiceContext.SubscriptionsInfoTableName, newItem);
            this.serviceContext.SaveChanges();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Subscription info record to be deleted.
 /// </summary>
 /// <param name="updatedItem">Subscription info record to be updated.</param>
 public void Update(SubscriptionInfoDataModel updatedItem)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Delete a subscription from the system. Higher level should clean up subscriptions in the system, i.e. remove devices from the subscription
 /// </summary>
 /// <param name="item">Subscription info record to be deleted.</param>
 public void Delete(SubscriptionInfoDataModel item)
 {
     this.serviceContext.DeleteObject(item);
     this.serviceContext.SaveChanges();
 }
        // CRUD operations below

        /// <summary>
        /// Used to create / insert a new subscription.
        /// </summary>
        /// <param name="newItem">Subscription info record to be inserted.</param>
        public void Insert(SubscriptionInfoDataModel newItem)
        {
            this.serviceContext.AddObject(MessageServiceContext.SubscriptionsInfoTableName, newItem);
            this.serviceContext.SaveChanges();
        }
 /// <summary>
 /// Subscription info record to be deleted.
 /// </summary>
 /// <param name="updatedItem">Subscription info record to be updated.</param>
 public void Update(SubscriptionInfoDataModel updatedItem)
 {
     throw new NotImplementedException();
 }