Esempio n. 1
0
    public User async GetByIdAsync(int id)
    {
        using (var dbContext = new MyDbContext())
        {
            var data = await dbContext.FindAsync((UserData user) => user.Id == id);

            return(new User(data));
        }
    }
Esempio n. 2
0
 public virtual async Task <T> SelectId(int id)
 {
     return(await _context.FindAsync <T>(id));
 }
        public async Task <Department> GetByIdAsync(int departmentId)
        {
            var one = await _myDbContext.FindAsync <Department>(departmentId);

            return(one);
        }
Esempio n. 4
0
        public async Task <Employee> GetOneAsync(int id)
        {
            var one = await _myDbContext.FindAsync <Employee>(id);

            return(one);
        }