public virtual T Get(Func <T, bool> where, params Expression <Func <T, object> >[] conditions) { IQueryable <T> dbQuery = _context.Set <T>(); foreach (Expression <Func <T, object> > con in conditions) { dbQuery = dbQuery.Include(con); } return(dbQuery.FirstOrDefault(where)); }
public List <UserKaniWaniList> TestGetWaniKaniVocabList(int userId) { var list = new List <UserKaniWaniList>(); try { list = _context.Set <UserKaniWaniList>().FromSql("SELECT TOP 10 Level, Character, Kana, Meaning FROM vwUserKaniWaniVocabList WHERE UserId = " + userId).ToList(); } catch (Exception ex) { Logger.HandleException(ex); } return(list); }