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