本文整理汇总了C#中IEnumerable.AsReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C# IEnumerable.AsReadOnly方法的具体用法?C# IEnumerable.AsReadOnly怎么用?C# IEnumerable.AsReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnumerable
的用法示例。
在下文中一共展示了IEnumerable.AsReadOnly方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DbDeclaration
public DbDeclaration(IEnumerable<DbVariableDeclaration> variables,
DbSelectExpression source)
: base(DbExpressionType.Declaration, typeof(void))
{
_variables = variables.AsReadOnly();
_source = source;
}
示例2: QueryCommand
public QueryCommand(string commandText, IEnumerable<QueryParameter> parameters,
IEnumerable<DbColumnExpression> columns)
{
this.commandText = commandText;
this.parameters = parameters.AsReadOnly();
this.columns = columns.AsReadOnly();
}
示例3: JsMethod
public JsMethod(IMember csharpMember, string name, IEnumerable<string> typeParameterNames, JsFunctionDefinitionExpression definition)
{
CSharpMember = csharpMember;
Name = name;
TypeParameterNames = typeParameterNames.AsReadOnly();
Definition = definition;
}
示例4: DbFunctionExpression
public DbFunctionExpression(Type type, string name,
IEnumerable<Expression> arguments)
: base(DbExpressionType.Function, type)
{
_name = name;
_arguments = arguments.AsReadOnly();
}
示例5: JsSwitchSection
public JsSwitchSection(IEnumerable<JsExpression> values, JsStatement body) {
if (values == null) throw new ArgumentNullException("values");
if (body == null) throw new ArgumentNullException("body");
Values = values.AsReadOnly();
if (Values.Count == 0) throw new ArgumentException("Values cannot be empty", "values");
Body = JsStatement.EnsureBlock(body);
}
示例6: DbInsertExpression
public DbInsertExpression(DbTableExpression table,
IEnumerable<DbColumnAssignment> assignments)
: base(DbExpressionType.Insert, typeof(int))
{
_table = table;
_assignments = assignments.AsReadOnly();
}
示例7: DbUpdateExpression
public DbUpdateExpression(DbTableExpression table,
Expression where, IEnumerable<DbColumnAssignment> assignments)
: base(DbExpressionType.Update, typeof(int))
{
_table = table;
_where = where;
_assignments = assignments.AsReadOnly();
}
示例8: DbClientJoinExpression
public DbClientJoinExpression(DbProjectionExpression projection,
IEnumerable<Expression> outerKey, IEnumerable<Expression> innerKey)
: base(DbExpressionType.ClientJoin, projection.Type)
{
_outerKey = outerKey.AsReadOnly();
_innerKey = innerKey.AsReadOnly();
_projection = projection;
}
示例9: JsMethod
public JsMethod(IMember csharpMember, string name, IEnumerable<string> typeParameterNames, JsFunctionDefinitionExpression definition)
{
Require.ValidJavaScriptIdentifier(name, "name");
CSharpMember = csharpMember;
Name = name;
TypeParameterNames = typeParameterNames.AsReadOnly();
Definition = definition;
}
示例10: SelectClauseExpression
public SelectClauseExpression(IEnumerable<SelectorExpression> selectors, bool distinct)
{
_nodeType = CqlExpressionType.SelectColumns;
_distinct = distinct;
_selectors = selectors.AsReadOnly();
for (int i = 0; i < _selectors.Count; i++)
_selectors[i].Ordinal = i;
}
示例11: SelectorExpression
public SelectorExpression(MethodInfo function, IEnumerable<SelectorExpression> arguments)
{
if (function.DeclaringType != typeof (CqlFunctions))
throw new ArgumentException("function must be a valid Cql Function");
_function = function;
_arguments = arguments.AsReadOnly();
_type = function.ReturnType;
_selectorType = CqlExpressionType.FunctionSelector;
}
示例12: DbSelectExpression
public DbSelectExpression(DbTableAlias alias,
IEnumerable<DbColumnDeclaration> columns,
Expression from, Expression where,
IEnumerable<DbOrderExpression> orderBy,
IEnumerable<Expression> groupBy,
bool isDistinct, Expression skip, Expression take)
: base(DbExpressionType.Select, typeof(void), alias)
{
_isDistinct = isDistinct;
_columns = columns.AsReadOnly();
_from = from;
_where = where;
_orderBy = orderBy.AsReadOnly();
_groupBy = groupBy.AsReadOnly();
_take = take;
_skip = skip;
}
示例13: TermExpression
private TermExpression(TermExpression original, IEnumerable<TermExpression> terms,
IDictionary<TermExpression, TermExpression> dictTerms)
{
_function = original.Function;
_termType = original._termType;
_type = original.Type;
_value = original.Value;
_terms = terms.AsReadOnly();
_dictionaryTerms = dictTerms.AsReadOnly();
}
示例14: IRMultiUnit
public IRMultiUnit(IEnumerable<IIRUnit> inner)
{
Inner = inner.AsReadOnly();
}
示例15: Json
public static ConstructorScriptSemantics Json(IEnumerable<IMember> parameterToMemberMap)
{
return new ConstructorScriptSemantics { Type = ImplType.Json, _parameterToMemberMap = parameterToMemberMap.AsReadOnly(), GenerateCode = false };
}