Exemple #1
0
 public IEnumerable <image> GetImgs()
 {
     using (var ctx = new ImgMetadataDbCon())
     {
         return(ctx.images.Include("repository").ToList());
     }
 }
Exemple #2
0
 public long GetImgsCount()
 {
     using (var ctx = new ImgMetadataDbCon())
     {
         return(ctx.images.Count());
     }
 }
Exemple #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());
     }
 }