예제 #1
0
 public Image GetById(int id)
 {
     using var context = new ImageDbContext(_connectionString);
     return(context.Images.FirstOrDefault(i => i.Id == id));
 }
예제 #2
0
 public List <Image> GetAll()
 {
     using var context = new ImageDbContext(_connectionString);
     return(context.Images.OrderByDescending(i => i.TimeUploaded).ToList());
 }