// GET: api/Alerts
        public IQueryable<AlertModel> GetAlerts()
        {
            HashSet<AlertModel> alerts = new HashSet<AlertModel>
            {
                new AlertModel
                {
                    CreatedAt = DateTime.Now.AddMinutes(-3),
                    DigitalOutput = 1,
                    OutputText = "Camera1"
                },

                new AlertModel
                {
                    CreatedAt = DateTime.Now.AddMinutes(-2),
                    DigitalOutput = 2,
                    OutputText = "Camera2"
                },

                new AlertModel
                {
                    CreatedAt = DateTime.Now.AddMinutes(-1),
                    DigitalOutput = 3,
                    OutputText = "Camera3"
                },

                new AlertModel
                {
                    CreatedAt = DateTime.Now,
                    DigitalOutput = 4,
                    OutputText = "Camera4"
                }
            };
            return alerts.AsQueryable();
        }
        public HttpResponseMessage GetAll()
        {
            var httpResponse = this.PerformOperation(() =>
                {
                    var schoolEntities = this.unitOfWork.SchoolsRepository.GetAll().ToList();
                    var schoolModels = new HashSet<SchoolModel>();
                    foreach (var schoolEntity in schoolEntities)
                    {
                        schoolModels.Add(SchoolsMapper.ToSchoolModel(schoolEntity));
                    }

                    return schoolModels.AsQueryable<SchoolModel>();
                });

            return httpResponse;
        }
        public HttpResponseMessage Get(string subject, double value)
        {
            var httpResponse = this.PerformOperation(() =>
                {
                    var studentEntities = this.unitOfWork.StudentsRepository
                        .GetBySubjectAndMark(subject, value).ToList();
                    var studentModels = new HashSet<StudentModel>();
                    foreach (var studentEntity in studentEntities)
                    {
                        studentModels.Add(StudentsMapper.ToStudentModel(studentEntity));
                    }

                    return studentModels.AsQueryable<StudentModel>();
                });

            return httpResponse;
        }
 protected virtual IQueryable<string> GetAssemblyFilesToReference(ISitecoreConnectionSettings settings)
 {
     var list = new List<Assembly>
     {
         Assembly.Load(new AssemblyName("Sitecore.ContentSearch")),
         Assembly.Load(new AssemblyName("Sitecore.ContentSearch.Linq")),
         typeof(IQueryable).Assembly
     };
     var selectedType = settings.SearchResultType.GetSelectedType();
     if (selectedType != null)
     {
         list.Add(selectedType.Assembly);
     }
     var assemblies = new HashSet<Assembly>();
     foreach (var assembly in list)
     {
         this.AddAssemblyFiles(assembly, assemblies);
     }
     return (from a in assemblies.AsQueryable<Assembly>() select a.Location);
 }
        public IQueryable<StudentsModel> Get(string subject, double value)
        {
            var httpResponse = this.PerformOperationAndHandleExceptions(() =>
                {
                    var studentEntities = this
                        .GetBySubjectAndMark(subject, value).ToList();
                    var studentModels = new HashSet<StudentsModel>();
                    foreach (var studentEntity in studentEntities)
                    {
                        studentModels.Add(
                            new StudentsModel() 
                            { 
                                FirstName = studentEntity.FirstName,
                                LastName = studentEntity.LastName,
                                Age = studentEntity.Age,
                                Grade = studentEntity.Grade
                            });
                    }

                    return studentModels.AsQueryable<StudentsModel>();
                });

            return httpResponse;
        }