//public Guid? VetId //{ // get { return _VetId; } // set { _VetId = value; } //} //private Guid? _VetId = null; public int ExecuteNonQuery() { //CacheHelper.AddUpdateItem<ProviderGroup, Pet>(this.ProviderGroupId.ToString(), this, (cache) => cache.PetCollection.Where(x => x.Id == this.Id).SingleOrDefault()); int result = MessageExtensions.ExecuteNonQuery <Pet>(this); return(result); }
public int ExecuteNonQuery() { using (DataContext context = DataContext.CreateForMessage(this)) { MessageExtensions.ExecuteNonQuery(this, context); foreach (Guid petId in this.PetList) { PetReservation petReservation = new PetReservation() { ReservationId = this.Id, PetId = petId, ProviderId = this.ProviderId }; context.PetReservationSet.Add(petReservation); } return(context.SaveChanges()); } }
public int ExecuteNonQuery() { using (DataContext context = DataContext.CreateForMessage(this)) { // Step 1. Get the sku Sku sku = context.SkuSet.Where(x => x.Id == this.SkuId && x.ProviderId == this.ProviderId).SingleOrDefault(); if (sku == null) { throw new InvalidOperationException("Unable to find sku."); } // Step 2. Set sku values this.Description = sku.Description; this.Name = sku.Name; // Step 3. Save return MessageExtensions.ExecuteNonQuery(this); } }
public int Execute() { return(MessageExtensions.ExecuteNonQuery(this)); }