Added very nice DataGrid control
This commit is contained in:
17
UserService.DatabaseLayer/Queryable.cs
Normal file
17
UserService.DatabaseLayer/Queryable.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace System.Linq
|
||||
{
|
||||
public static class Queryable
|
||||
{
|
||||
/// <summary>
|
||||
/// Makes a where filtering, if it is not null.
|
||||
/// </summary>
|
||||
public static IQueryable<TSource> WhereOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>>? predicate)
|
||||
{
|
||||
if (source == null) throw new ArgumentNullException(nameof(source));
|
||||
return predicate is null ? source : source.Where(predicate);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user