Пример #1
0
 public override async Task <Picture?> FindAsync(params object[] id)
 {
     if (!(id[0] is int))
     {
         return(null);
     }
     return(PictureMapper.MapFromDomain(await RepositoryDbSet.AsNoTracking().FirstOrDefaultAsync(pic => pic.Id == (int)id[0])));
 }
Пример #2
0
 public async Task <IEnumerable <Picture> > FindPicturesByPathAsync(string path)
 {
     return(await RepositoryDbSet.Where(pic => pic.Path == path).AsNoTracking()
            .Select(p => PictureMapper.MapFromDomain(p)).ToListAsync());
 }