コード例 #1
0
        /// <summary>
        /// By default queries the table matching the class name.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public IEnumerable <T> GetList <T>()
        {
            SetSimpleCRUD();

            using (var conn = new SqlConnection(_connectionString))
            {
                conn.Open();
                IEnumerable <T> ret = _simpleCRUD.GetList <T>(conn);
                conn.Close();
                return(ret);
            }
        }
コード例 #2
0
        public List <PetOwner> GetList()
        {
            List <PetOwner> result = GetCache().ToList();

            if (!result.Any())
            {
                var persons = SimpleCRUD.GetList <Person>(_connection);
                if (persons != null && persons.Any())
                {
                    foreach (var person in persons)
                    {
                        var pets  = GetPetsForOwner(person.Id);
                        var model = ToModel(person, pets);
                        result.Add(model);
                        UpdateCache(model, model.Id.ToString());
                    }
                }
            }
            return(result);
        }
コード例 #3
0
 public virtual IEnumerable <TModel> GetList(object whereConditions, IDbTransaction transaction = null, int?commandTimeout = null)
 {
     return(SimpleCRUD.GetList <TModel>(_connection, whereConditions, transaction, commandTimeout));
 }
コード例 #4
0
 public IEnumerable <Genre> GetList()
 {
     return(SimpleCRUD.GetList <Genre>(Connection));
 }
コード例 #5
0
 public virtual IEnumerable <TModel> GetList(string conditions, object parameters = null, IDbTransaction transaction = null, int?commandTimeout = null)
 {
     return(SimpleCRUD.GetList <TModel>(_connection, conditions, parameters, transaction, commandTimeout));
 }