mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-04-24 16:50:38 +03:00
make backend for my site
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace yawaflua.ru.Utilities
|
||||
{
|
||||
public static class AppDbContextUtilities
|
||||
{
|
||||
public static bool TryGetValue<T>(this DbSet<T> set, Func<T, bool> predicate, out T? value) where T : class
|
||||
{
|
||||
value = set.FirstOrDefault(predicate);
|
||||
return value != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user