Dependency Upgrades
This commit is contained in:
parent
ff968a490f
commit
3108a68407
5 changed files with 32 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -13,5 +14,15 @@ namespace Geekbot.net.Lib.Extensions
|
|||
var exists = predicate != null ? dbSet.Any(predicate) : dbSet.Any();
|
||||
return !exists ? dbSet.Add(entity) : null;
|
||||
}
|
||||
|
||||
// https://github.com/dotnet/efcore/issues/18124
|
||||
public static IAsyncEnumerable<TEntity> AsAsyncEnumerable<TEntity>(this Microsoft.EntityFrameworkCore.DbSet<TEntity> obj) where TEntity : class
|
||||
{
|
||||
return Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AsAsyncEnumerable(obj);
|
||||
}
|
||||
public static IQueryable<TEntity> Where<TEntity>(this Microsoft.EntityFrameworkCore.DbSet<TEntity> obj, System.Linq.Expressions.Expression<Func<TEntity, bool>> predicate) where TEntity : class
|
||||
{
|
||||
return System.Linq.Queryable.Where(obj, predicate);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue