当前位置: 首页>>代码示例>>C#>>正文


C# HashSet.AsQueryable方法代码示例

本文整理汇总了C#中HashSet.AsQueryable方法的典型用法代码示例。如果您正苦于以下问题:C# HashSet.AsQueryable方法的具体用法?C# HashSet.AsQueryable怎么用?C# HashSet.AsQueryable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HashSet的用法示例。


在下文中一共展示了HashSet.AsQueryable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAlerts

        // 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();
        }
开发者ID:avantiaipd,项目名称:AvvaHostEmulator,代码行数:35,代码来源:AlertsController.cs

示例2: GetAll

        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;
        }
开发者ID:vladislav-karamfilov,项目名称:TelerikAcademy,代码行数:16,代码来源:SchoolsController.cs

示例3: Get

        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;
        }
开发者ID:vladislav-karamfilov,项目名称:TelerikAcademy,代码行数:17,代码来源:StudentsController.cs

示例4: GetAssemblyFilesToReference

 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);
 }
开发者ID:adamconn,项目名称:sitecore-linqpad,代码行数:20,代码来源:SitecoreSchemaBuilder.cs

示例5: Get

        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;
        }
开发者ID:HansS,项目名称:TelerikAcademy-homework,代码行数:24,代码来源:StudentsController.cs


注:本文中的HashSet.AsQueryable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。