private bool LoadByPrimaryKeyDynamic(System.Int32 storeId, System.Int16 paymentProviderId)
        {
            StorePaymentProviderQuery query = new StorePaymentProviderQuery();

            query.Where(query.StoreId == storeId, query.PaymentProviderId == paymentProviderId);
            return(this.Load(query));
        }
        protected void InitQuery(StorePaymentProviderQuery query)
        {
            query.OnLoadDelegate = this.OnQueryLoaded;

            if (!query.es2.HasConnection)
            {
                query.es2.Connection = ((IEntityCollection)this).Connection;
            }
        }
        public static StorePaymentProvider GetOrCreate(int storeId, short providerId)
        {
            // check if the StorePaymentProvider exists...if not, create it
            StorePaymentProviderQuery q = new StorePaymentProviderQuery();

            q.Where(q.StoreId == storeId, q.PaymentProviderId == providerId);

            StorePaymentProvider storeProvider = new StorePaymentProvider();

            if (!storeProvider.Load(q))
            {
                storeProvider.StoreId           = storeId;
                storeProvider.PaymentProviderId = providerId;
                storeProvider.Save();
            }

            return(storeProvider);
        }
 public bool Load(StorePaymentProviderQuery query)
 {
     this.query = query;
     InitQuery(this.query);
     return(Query.Load());
 }