Esempio n. 1
0
        public BaseSqlRepository()
        {
            Database = new SimpleDataAccess("<Your_App_Connection_String_Name>");

            // if for somereason you need to roll your own Sql connection provider
            // Database = new SimpleDataAccess(new SimpleSqlConnectionProvider("<Your_App_Connection_String_Name>"));
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="table">
        /// IdbTable with defined structure
        /// </param>
        /// <param name="includeFields">
        /// Which fields are included in data group
        /// </param>
        /// <param name="whereCause">
        /// Where cause to select corresponding record
        /// </param>
        public DataGroup(
            IDbTable table,
            ISimpleDataAccess dataAccess,
            string[] includeFields,
            string whereCause)
        {
            Validation.RequireValid(table, "table");
            Validation.RequireValid(dataAccess, "dataAccess");
            Validation.RequireValid(includeFields, "includeFields");
            Validation.RequireValidString(whereCause, "whereCause");

            if (includeFields.Length < 1)
            {
                throw new LythumException("DataGroup: Must be at least one data group field!");
            }

            this.Table         = table;
            this.DataAccess    = dataAccess;
            this.IncludeFields = includeFields;
            this.WhereCause    = whereCause;

            this.IsDataLoaded = false;
        }