Blog.DAL.PostTagDAL.pobierzPorcje C# (CSharp) Method

pobierzPorcje() public method

public pobierzPorcje ( int ile, int offset ) : List
ile int
offset int
return List
        public List<Models.PostTagModel> pobierzPorcje(int ile, int offset)
        {
            using (LinqTodbBlogDataContext db = new LinqTodbBlogDataContext())
            {
                try
                {
                    var lista = (from a in db.PostyTagis
                                 where a.status != 0
                                 orderby a.data_dodania descending
                                 select new Models.PostTagModel
                                 {
                                     Tytul = a.tytul,
                                     Tresc = a.tresc,
                                     Status = a.status,
                                     Keywords = a.keywords,
                                     Id = a.id,
                                     Desc = a.description,
                                     DataModyfikacji = a.data_modyfikacji,
                                     DataDodania = a.data_dodania,
                                 }).Skip(ile * offset).Take(ile).ToList();
                    return lista;
                }
                catch (Exception)
                {
                    throw new Exception("Wystąpił błąd podczas pobierania wpisów");
                }
            }
        }