Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SingleOrDefault< TSource >() [3/4]

static TSource System.Linq.Queryable.SingleOrDefault< TSource > ( this IQueryable< TSource > source,
Expression< Func< TSource, bool > > predicate,
TSource defaultValue )
inlinestatic

Definition at line 1151 of file Queryable.cs.

1152 {
1153 if (source == null)
1154 {
1155 throw Error.ArgumentNull("source");
1156 }
1157 if (predicate == null)
1158 {
1159 throw Error.ArgumentNull("predicate");
1160 }
1161 return source.Provider.Execute<TSource>(Expression.Call(null, CachedReflectionInfo.SingleOrDefault_TSource_4(typeof(TSource)), source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))));
1162 }
static ConstantExpression Constant(object? value)
static MethodCallExpression Call(MethodInfo method)
static UnaryExpression Quote(Expression expression)

References System.Linq.Error.ArgumentNull(), System.Linq.Expressions.Expression< TDelegate >.Call(), System.Linq.Expressions.Expression< TDelegate >.Constant(), System.Linq.predicate, System.Linq.Expressions.Expression< TDelegate >.Quote(), System.Linq.CachedReflectionInfo.SingleOrDefault_TSource_4(), and System.Linq.source.