예제 #1
0
        public virtual async Task <T> Get(int id)
        {
            var obj = await _context.Set <T>()
                      .AsNoTracking()
                      .Where(x => x.Id == id)
                      .FirstOrDefaultAsync();

            return(obj);
        }
예제 #2
0
        public virtual async Task <T> Get(long id)
        {
            var obj = await _contexte.Set <T>()
                      .AsNoTracking()
                      .Where(x => x.Id == id)
                      .ToListAsync();

            return(obj.FirstOrDefault());
        }