Skip to content

Instantly share code, notes, and snippets.

View robinthomas's full-sized avatar

Robin Thomas robinthomas

View GitHub Profile
@robinthomas
robinthomas / LeesStoreDbContextModelCreatingExtensions.cs
Created December 14, 2020 17:57 — forked from lprichar/LeesStoreDbContextModelCreatingExtensions.cs
Auto Entity Model Adding During DB Context Creation via Reflection for ABP.IO
var allDbSets = typeof(LeesStoreDbContext).GetProperties()
.Where(p => p.PropertyType.Name == "DbSet`1")
.Select(p => new
{
Type = p.PropertyType.GetGenericArguments()[0],
p.Name
})
.Where(p => p.Name != nameof(LeesStoreDbContext.Users));
foreach (var property in allDbSets)