Code Monkey home page Code Monkey logo

daarto's Introduction

Daarto

The main purpose of the project is to demonstrate a custom implementation of ASP.NET Core Identity by using SQL Server and Dapper, in case you do not want to use the default implementation provided by Entity Framework. The application uses ASP.NET Core 2.1 and is built by using Visual Studio 2017 Community Edition and SQL Local DB.

Getting Started

In order to successfully run the application, the only thing you have to do is re-create the database used, in your local machine. Inside misc/scripts folder you will find a file called create_database_schema.sql. Execute this T-SQL script in SQL Server Management Studio Query Window and all the required tables will be created automatically in a database called DaartoDb. The schema is the default one, which is also used by ASP.NET Core Identity. Then run the following scripts in the order displayed below, to generate some demo data (they are random and created by using a very handy online tool called mockaroo).

One last step is to run a Gulp task in order to copy some npm packages in the wwwroot/lib. The task we need to run is called copy:libs

In Visual Studio navigate to View -> Other Windows -> Task Runner Explorer to be able to run this task easily.

When running the application use the following credentials to use an administrator's account

Logging in with the administrator role will give you the ability to access the admin dashboard.

I will try to add more features as i develop the application. If you like my work, feel free to use this project as a starting point for your own applications.

Use as Nuget package

I have published the AspNetCore.Identity.Dapper project as a NuGet package. In order to install the package use the following command.

PM> Install-Package AspNetCore.Identity.DapperOrm

In order to register the IUserStore and IRoleStore store implementations, you will need to use the AddDapperStores extension method when configuring identity in your ConfigureServices method.

// Get the connection string from appsettings.json file.
var connectionString = Configuration.GetConnectionString("DefaultConnection");
// Add and configure the default identity system that will be used in the application.
services.AddIdentity<ApplicationUser, ApplicationRole>()
        .AddUserManager<UserManager<ApplicationUser>>()
        .AddRoleManager<RoleManager<ApplicationRole>>()
        .AddSignInManager<SignInManager<ApplicationUser>>()
        .AddDapperStores(connectionString)
        .AddDefaultTokenProviders();

daarto's People

Contributors

giorgos07 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.