make backend for my site

This commit is contained in:
yawaflua
2024-04-17 22:55:07 +03:00
parent 83c7fc1723
commit 1075225001
50 changed files with 571 additions and 312 deletions

View File

@@ -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;
}
}
}