mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2025-12-09 20:19:32 +02:00
14 lines
356 B
C#
14 lines
356 B
C#
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;
|
|
}
|
|
}
|
|
}
|