An application framework for building applications on ASP.NET Core
/ A EntityFramework Core part of framework on top of the PlatformFramework
/ A Identity part of framework on top of the PlatformFramework.EFCore
From the Package Manager Console:
PM> Install-Package Dot
PM> Install-Package Dot.EFCore
PM> Install-Package Dot.EFCore.Identity
- In your
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services
.AddFramework(x =>
{
// add modules
x.AddModule<ApplicationModule>();
x.AddModule<PlatformIdentityModule>();
});
....
}
- In your
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services
.AddEfCore<ProjectDbContext>(o => //configure DbContext and `IUnitOfWork`
{
var connectionString = "__CONNECTION_STRING__";
o.UseNpgsql(connectionString, assembly => assembly.MigrationsAssembly(Assembly.GetExecutingAssembly().FullName));
})
.WithMigrationInitializer() // add DBContext migrator to startup
.WithHooks(x => // add `on SaveChanges` entity hooks
{
x.WithTrackingHooks();
x.WithSoftDeletedEntityHook();
})
.WithEntities(x => // add Entities to DbContext
{
x.ApplyConfiguration<MyEntity, MyEntityConfiguration>();
});
....
}
- Download Visual Studio 2019 (any edition) from https://www.visualstudio.com/downloads/
- Open
PlatformFramework.sln
and wait for Visual Studio to restore all Nuget packages - Samples are in to try out (navigate to /swagger for API test)
- Clone the repository using the command
git clone https://github.com/vermilion/PlatformFramework.git
and checkout themaster
branch. Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Licenced under MIT.