mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 05:23:13 +00:00
VarList
This commit is contained in:
@ -47,6 +47,10 @@ public static class EsiurExtensions
|
||||
|
||||
//}
|
||||
|
||||
public static DbSet<object> SetByType(this DbContext context, Type t)
|
||||
{
|
||||
return (DbSet<object>)context.GetType().GetMethod("Set").MakeGenericMethod(t).Invoke(context, new object[0]);
|
||||
}
|
||||
|
||||
public static T AddResource<T>(this DbSet<T> dbSet, T resource) where T : class, IResource
|
||||
=> AddResourceAsync(dbSet, resource).Wait();
|
||||
|
Reference in New Issue
Block a user