Ejemplo n.º 1
0
        public List <MAccount> GetAll(AccountSearchRequest search)
        {
            var query = _context.Set <Account>().AsQueryable();

            query = query.Include(u => u.User);
            if (search.Username != null)
            {
                query = query.Where(u => u.Username == search.Username);
            }

            var list = query.ToList();

            return(_mapper.Map <List <MAccount> >(list));
        }
Ejemplo n.º 2
0
        public virtual TModel GetById(int id)
        {
            var entity = _context.Set <TDatabase>().Find(id);

            return(_mapper.Map <TModel>(entity));
        }