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


C# IEnumerable.ToReadOnlyList方法代码示例

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


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

示例1: BlogSettingsHelper

        public BlogSettingsHelper(IEnumerable<BlogSetting> blogSettings)
        {
            if (blogSettings == null)
            {
                throw new ArgumentNullException(nameof(blogSettings));
            }

            this.blogSettings = blogSettings.ToReadOnlyList();

            this.BlogKeys =
                this.blogSettings.Select(x => new BlogKey(x.BlogKey)).Where(x => x.HasValue).ToReadOnlyList();
        }
开发者ID:sebnilsson,项目名称:Blaven,代码行数:12,代码来源:BlogSettingsHelper.cs

示例2: SqlSelectExpression

 public SqlSelectExpression(Type type, string alias, IEnumerable<SqlColumnDeclaration> columns, Expression from, Expression where, IEnumerable<Expression> orderBy, bool forUpdate)
     : this(type, alias, columns.ToReadOnlyList(), from, where, orderBy.ToReadOnlyList(), null, false, null, null, forUpdate)
 {
 }
开发者ID:smadep,项目名称:Shaolinq,代码行数:4,代码来源:SqlSelectExpression.cs

示例3: ChangeColumns

 public SqlSelectExpression ChangeColumns(IEnumerable<SqlColumnDeclaration> columns, bool columnsAlreadyOrdered)
 {
     return new SqlSelectExpression(this.Type, this.Alias, columnsAlreadyOrdered ? columns.ToReadOnlyList() : columns.OrderBy(c => c.Name).ToReadOnlyList(), this.From, this.Where, this.OrderBy, this.GroupBy, this.Distinct, this.Take, this.Skip, this.ForUpdate);
 }
开发者ID:smadep,项目名称:Shaolinq,代码行数:4,代码来源:SqlSelectExpression.cs

示例4: SqlCreateIndexExpression

 public SqlCreateIndexExpression(string indexName, SqlTableExpression table, bool unique, bool lowercaseIndex, IndexType indexType, bool ifNotExist, IEnumerable<SqlIndexedColumnExpression> columns)
     : this(indexName, table, unique, lowercaseIndex, indexType, ifNotExist, columns.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlCreateIndexExpression.cs

示例5: SqlReferencesColumnExpression

 public SqlReferencesColumnExpression(SqlTableExpression referencedTable, SqlColumnReferenceDeferrability deferrability, IEnumerable<string> referencedColumnNames, SqlColumnReferenceAction onDelete, SqlColumnReferenceAction onUpdate)
     : this(referencedTable, deferrability, referencedColumnNames.ToReadOnlyList(), onDelete, onUpdate)
 {
 }
开发者ID:smadep,项目名称:Shaolinq,代码行数:4,代码来源:SqlReferencesColumnExpression.cs

示例6: SqlCreateTableExpression

		public SqlCreateTableExpression(SqlTableExpression table, bool ifNotExist, IEnumerable<SqlColumnDefinitionExpression> columnExpressions, IEnumerable<Expression> tableConstraintExpressions)
			: this(table, ifNotExist, columnExpressions.ToReadOnlyList(), tableConstraintExpressions.ToReadOnlyList())
		{
		}
开发者ID:bkristensen,项目名称:Shaolinq,代码行数:4,代码来源:SqlCreateTableExpression.cs

示例7: SqlForeignKeyConstraintExpression

 public SqlForeignKeyConstraintExpression(string constraintName, IEnumerable<string> columnNames, SqlReferencesColumnExpression referencesColumnExpression)
     : this(constraintName, columnNames.ToReadOnlyList(), referencesColumnExpression)
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlForeignKeyConstraintExpression.cs

示例8: SqlQueryFormatResult

 public SqlQueryFormatResult(string commandText, IEnumerable<Tuple<Type, object>> parameterValues)
     : this(commandText, parameterValues.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlQueryFormatResult.cs

示例9: ResolveField

        private async Task<object> ResolveField( ExecutionContext context, ObjectGraphType parentType, object source, IEnumerable<Field> fields, List<ExecutionError> executionErrors )
        {
            context.CancellationToken.ThrowIfCancellationRequested();

            IReadOnlyList<Field> fieldsAsReadOnlyList = fields.ToReadOnlyList();

            Field field = fieldsAsReadOnlyList.First();

            FieldType fieldDefinition = GetFieldDefinition(context.Schema, parentType, field);
            if (fieldDefinition == null)
            {
                return null;
            }

            IReadOnlyDictionary<string, object> arguments = GetArgumentValues(context.Schema, fieldDefinition.Arguments, field.Arguments, context.Variables);

            Func<ResolveFieldContext, object> defaultResolve =
                ctx =>
                {
                    return ctx.Source != null ? GetProperyValue(ctx.Source, ctx.FieldAst.Name) : null;
                };

            try
            {
                ResolveFieldContext resolveContext = new ResolveFieldContext(
                    field.Name,
                    field,
                    fieldDefinition,
                    context.Schema.FindType( fieldDefinition.Type ),
                    parentType,
                    arguments,
                    context.RootValue,
                    source,
                    context.Schema,
                    context.Operation,
                    context.Fragments,
                    context.Variables,
                    context.CancellationToken,
                    context.UserContext );

                Func<ResolveFieldContext, object> resolve = fieldDefinition.Resolve ?? defaultResolve;
                object result = resolve( resolveContext );

                Task resultAsTask = result as Task;
                if( resultAsTask != null )
                {
                    await resultAsTask;
                    result = GetProperyValue( resultAsTask, "Result" );
                }

                if ( fieldDefinition.IsPluralIdentifyingRootField )
                {
                    ThrowIfPluralIdentifyingRootFieldRequirementsNotMet(
                        result,
                        resolveContext );
                }
                
                __Field parentTypeAsField = parentType as __Field;
                Type resultAsType = result as Type;
                if ( parentTypeAsField != null &&
                     resultAsType != null )
                {
                    result = context.Schema.FindType( resultAsType );
                }

                return await CompleteValue(
                    context,
                    context.Schema.FindType( fieldDefinition.Type ),
                    fieldsAsReadOnlyList,
                    result,
                    executionErrors );
            }
            catch( Exception exception )
            {
                executionErrors.Add(
                    new ExecutionError( string.Format( "Error trying to resolve {0}.", field.Name ), exception ) );

                return null;
            }
        }
开发者ID:husterk,项目名称:graphql-dotnet,代码行数:80,代码来源:DocumentExecuter.cs

示例10: SqlStatementListExpression

 public SqlStatementListExpression(IEnumerable<Expression> statements)
     : this(statements.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlStatementListExpression.cs

示例11: SqlEnumDefinitionExpression

 public SqlEnumDefinitionExpression(IEnumerable<string> labels)
     : this(labels.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlEnumDefinitionExpression.cs

示例12: SqlFunctionCallExpression

 public SqlFunctionCallExpression(Type type, string userDefinedFunctionName, IEnumerable<Expression> arguments)
     : this(type, SqlFunction.UserDefined, arguments.ToReadOnlyList())
 {
     this.UserDefinedFunctionName = userDefinedFunctionName;
 }
开发者ID:smadep,项目名称:Shaolinq,代码行数:5,代码来源:SqlFunctionCallExpression.cs

示例13: SqlColumnDefinitionExpression

 public SqlColumnDefinitionExpression(string columnName, Expression columnTypeName, IEnumerable<Expression> constraintExpressions)
     : this(columnName, columnTypeName, constraintExpressions.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlColumnDefinitionExpression.cs

示例14: SqlInsertIntoExpression

 public SqlInsertIntoExpression(SqlTableExpression table, IEnumerable<string> columnNames, IEnumerable<string> returningAutoIncrementColumnNames, IEnumerable<Expression> valueExpressions)
     : this(table, columnNames.ToReadOnlyList(), returningAutoIncrementColumnNames.ToReadOnlyList(), valueExpressions.ToReadOnlyList())
 {
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:4,代码来源:SqlInsertIntoExpression.cs

示例15: BindResult

 public BindResult(IEnumerable<SqlColumnDeclaration> columns, IEnumerable<SqlOrderByExpression> orderings)
 {
     this.Columns = columns.ToReadOnlyList();
     this.Orderings = orderings.ToReadOnlyList();
 }
开发者ID:ciker,项目名称:Shaolinq,代码行数:5,代码来源:SqlOrderByRewriter.cs


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