public List <Data> GetById(Int32 userId) { List <Data> datas; try { datas = DbSetT .Where(x => x.IdUser == userId).ToList(); } catch (Exception) { datas = new List <Data>(); } return(datas); }
public User GetByLogin(string login, string password) { User user; try { user = DbSetT .Where(x => x.Login == login) .Where(x => x.Password == password) .First(); // Entry(user).Collection(x => x.Roles).Load(); } catch (Exception) { user = new User(); } return(user); }