public OrgResponse GetOrgRandomResponseForMainPage() { var context = new SpecialistDataContext(); return(context.GetTable <OrgResponse>().Where(x => x.ShortDescription != null) .OrderBy(x => context.GetNewID()).FirstOrDefault()); }
public List <Advice> GetRandomAdvices() { var context = new SpecialistDataContext(); return(context.GetTable <Advice>().IsActive() .OrderBy(x => context.GetNewID()).Take(CommonConst.AdviceCount).ToList()); }
public List <Response> GetRandomForWebinar() { var context = new SpecialistDataContext(); return(context.GetTable <Response>().IsActive() .Where(x => x.IsWebinar) .OrderBy(x => context.GetNewID()).Take(15).ToList()); }
public Response GetRandomForMainPage(List <string> courseTCs) { var context = new SpecialistDataContext(); var response = context.GetTable <Response>().IsActive() .Where(x => x.Rating == ResponseRating.ForMain && courseTCs.Contains(x.Course_TC)) .OrderBy(x => context.GetNewID()).FirstOrDefault(); if (response != null) { return(response); } return(context.GetTable <Response>().IsActive() .Where(x => x.Rating == ResponseRating.ForMain) .OrderBy(x => context.GetNewID()).FirstOrDefault()); }
public List <Response> GetRandomResponsesByCourse(string CourseTC, int rows) { var context = new SpecialistDataContext(); return(context.GetTable <Response>().IsActive() .Where(x => x.Type == RawQuestionnaireType.CourseComment).Where(r => r.Course_TC == CourseTC) .OrderBy(x => context.GetNewID()).Take(rows).ToList()); }