mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-10-24 03:50:57 +00:00
Esiur CLI
This commit is contained in:
1 parent
3e8fb50110
commit
ac36a3ddc7
36 files changed
+2396
-304
No files matched your search
@@ -129,7 +129,7 @@ public static class EsiurExtensions
|
||||
var entity = dbSet.Add((T)res);
|
||||
await entity.Context.SaveChangesAsync();
|
||||
|
||||
var id = store.TypesByType[typeof(T)].PrimaryKey.GetValue(resource);
|
||||
var id = store.TypesByType[typeof(T)].PrimaryKey.GetValue(res);
|
||||
|
||||
var resourceContext = manager == null
|
||||
? null
|
||||
@@ -178,12 +178,25 @@ public static class EsiurExtensions
|
||||
extension = new EsiurExtensionOptions(store);
|
||||
}
|
||||
|
||||
if (getter != null)
|
||||
extension.Store.Getter = getter;
|
||||
|
||||
((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(extension);
|
||||
|
||||
return optionsBuilder;
|
||||
|
||||
}
|
||||
|
||||
public static DbContextOptionsBuilder<TContext> UseEsiur<TContext>(
|
||||
this DbContextOptionsBuilder<TContext> optionsBuilder,
|
||||
EntityStore store,
|
||||
Func<DbContext> getter = null)
|
||||
where TContext : DbContext
|
||||
{
|
||||
UseEsiur((DbContextOptionsBuilder)optionsBuilder, store, getter);
|
||||
return optionsBuilder;
|
||||
}
|
||||
|
||||
//public static DbContextOptionsBuilder<TContext> UseEsiur<TContext>(
|
||||
// this DbContextOptionsBuilder<TContext> optionsBuilder,
|
||||
// //DbContext context,
|
||||
|
||||
Reference in new issue
Block a user