示例#1
0
 public IEnumerable<image> GetImgs()
 {
     using (var ctx = new ImgMetadataDbCon())
     {
         return ctx.images.Include("repository").ToList();
     }
 }
示例#2
0
 public long GetImgsCount()
 {
     using (var ctx = new ImgMetadataDbCon())
     {
         return ctx.images.Count();
     }
 }
示例#3
0
 public IEnumerable<image> GetImgs(int pageNum, int pageSize)
 {
     using (var ctx = new ImgMetadataDbCon())
     {
         int toSkip = 0;
         if (pageNum > 1)
         {
             toSkip = (pageNum - 1) * pageSize;
         }
         return ctx.images.Include("repository").OrderByDescending(im => im.Id).Skip(toSkip).Take(pageSize).ToList();
     }
 }