Skip to content
/ Dot Public

Infrastructure for Building Web Applications - Web Application Framework

License

Notifications You must be signed in to change notification settings

vermilion/Dot

Repository files navigation

image

Dot Framework GitHub Workflow Status GitHub code size in bytes

Nuget An application framework for building applications on ASP.NET Core

Nuget / A EntityFramework Core part of framework on top of the PlatformFramework

Nuget / A Identity part of framework on top of the PlatformFramework.EFCore

Technologies

Installing

From the Package Manager Console:

PM> Install-Package Dot
PM> Install-Package Dot.EFCore
PM> Install-Package Dot.EFCore.Identity

Getting Started

PlatformFramework

  • In your Startup.cs
public void ConfigureServices(IServiceCollection services)
{
    services
        .AddFramework(x =>
        {
            // add modules
            x.AddModule<ApplicationModule>();
            x.AddModule<PlatformIdentityModule>();
        });
    
    ....
}

PlatformFramework.EFCore

  • 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>();
        });
            
    ....
}

Samples

  • 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)

Contributing

  • Clone the repository using the command git clone https://github.com/vermilion/PlatformFramework.git and checkout the master branch. Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Licences

Licenced under MIT.