AnaSoft Inc. - ApiNCore VS2017 extension template for Web Api REST .NET Core solutions
ApiNCore
loading...

Overview

ApiNCore Projects

ApiNCoreEx is a solution template VS 2017 extension for building .NET Core API EF solutions.

Features:

  • Three layers: Api, Domain and Entity
  • Automapper
  • DI (.NET Core feature)
  • UnitOfWork
  • Generic Service and Repository with Entity Framework ORM
  • Sync and Async calls
  • Generic exception handler
  • Serilog logging with Console and File sinks
  • EF migration and seed from json objects
  • JWT authorization and authentication option
  • Implemented IdentityServer4 with an OpenID Connect and OAuth 2.0 framework for ASP.NET Core 2.
  • Swagger and Swashbuckle with ASP.NET Core 2
  • XUnit tests run for both authentication types: JWT or IS4. Just change appsettings.
  • Postman API tests (JWT and IS4) for import as json file
  • T4 template generation with code detection of added new entity classes (inherits from BaseEntity) and generating related domain. service, controller and tests classes

Updates:

  • Version 3.0 (.NET Core 2.2)
  • Version 3.1 (added Swagger authentication)
  • Version 3.2 (fix POST/PUT use; update unittests)
  • Version 3.3 (T4 template code genertion for generation for domain. service, controller and tests classes)

Instructions (how to create your API start solution and run XUnit and Postman tests):

1. Download and install the extension (VSIX).
2. Open Visual Studio and select new ApiNCoreE (with ER ORM) solution template from Visual C# templates section.
3. Nuget dependencies should be restored automatically with Internet connection. If that is not happening then you can use command 'Manage Nuget Packages -> Restore' and run for each project.
4. Set and save connection string "Data Source" (server name) in configuration file (appsettings.json) for API project and Test project:
"ConnectionStrings":"YourSolutionNameDB": "Data Source=SetHereYourServerName;Initial Catalog=YourSolutionName;...",
5. Set in Visual Studio solution property page multiple projects startup for the API service and IndentityServer and run Visual Studio solution. When the VS run displays the info pages for API and IndentityServer than stop the run. The run triggers database migration and data seed code which creates and populates initial tables.
6. Run all tests in Test project. This time is used JWT as authetication service for the API.
7. Set and save in configuration file (appsettings.json) in Test project this setting:
"Authentication":"UseIndentityServer4": true,
8. Build the solution.
9. Run all tests in Test project. This time is used Indentity Server 4 as authetication service for the API.
10. Import Postman_tests_collection.json from Test project folder to Postman application.
11. Run JWT tests in Postman runner.
12. Set and save in configuration file (appsettings.json) in API project this setting:
"Authentication":"UseIndentityServer4": true,
13. Build the solution.
14. Run IS4 tests in Postman runner.

T4 templates code generation:
  • Create new class (must inherit from BaseEntity) in Entity project Entity folder,
  • Find T4 templates in this order (in Domain project Domain folder, than Service folder, than API project Controller folder and than Test project) (*.tt) file(s) and set property just once Custom Tool = TextTemplatingFileGenerator for each T4 template file (Note: Because there is no option in VSIX template settings to be set during project creation),
  • Saving entered Custom Tool property triggers the template execution,
  • For additional the template(s) execution use right-click tt file and Run Custom Tool command.

    ApiNCoreDx is a solution template VS 2017 extension for building .NET Core API Dapper solutions.

    Features:

    • Three layers: Api, Domain and Entity
    • Automapper
    • DI (.NET Core feature)
    • UnitOfWork
    • Generic Service and Repository with Dapper ORM
    • Sync and Async calls
    • Generic exception handler
    • Serilog logging with Console and File sinks
    • FluentMigrator runner migration and seed
    • JWT authorization and authentication
    • Implemented IdentityServer4 with an OpenID Connect and OAuth 2.0 framework for ASP.NET Core 2.
    • Swagger and Swashbuckle with ASP.NET Core 2
    • XUnit tests run for real database
    • Postman API tests for import as json file

    Updates:

    • Version 1.4 (.NET Core 2.2)
    • Version 1.5 (added Swagger authentication)
    • Version 1.6 (fix POST/PUT use; update unittests)

    Instructions:

    1. Download and install the extension (VSIX).
    2. Open Visual Studio and select new ApiNCoreD (with Dapper ORM) solution template from Visual C# templates section.
    3. Nuget dependencies should be restored automatically with Internet connection. If not then you can use command 'Manage Nuget Packages -> Restore' and run for each project.
    4. Once a solution is created the API service can run from Visual Studio with displaying the info page.
    5. The configuration file in API project appsettings(.Development).json has to be updated like below:
    "UseInMemoryDatabase": false,
    "YourSolutionNameDB": "your db connection string",

    For ApiNCoreD extension (with Dapper ORM) use these settings:
    "YourSolutionNameDBMigration": "your db connection string with no initial catalog specified",
    "YourSolutionNameDB": "your db connection string",

    6. Set in Visual Studio solution property page multiple projects startup for the API service and IndentityServer and run Visual Studio solution. When the VS run displays the info pages for API and IndentityServer than stop the run. The run triggers database migration and data seed code which creates and populates initial tables.
    7. Run all tests in Test project. This time is used JWT as authetication service for the API.
    8. Set and save in configuration file (appsettings.json) in Test project this setting:
    "Authentication":"UseIndentityServer4": true,
    9. Build the solution.
    10. Run all tests in Test project. This time is used Indentity Server 4 as authetication service for the API.
    10. Import Postman_tests_collection.json from Test project folder to Postman application.
    12. Run JWT tests in Postman runner.
    13. Set and save in configuration file (appsettings.json) in API project this setting:
    "Authentication":"UseIndentityServer4": true,
    14. Build the solution.
    15. Run IS4 tests in Postman runner.
    16. Done.
  • Screenshots

    Download full-featured VSIX extensions

    VS2017 ApiNCoreEx.vsix extension with Entity Framework and Indentity Server 4 and/or JWT with XUnit project integration tests and Postman tests json file.

    Get the extension for only $7 CAD.

    VS2017 ApiNCoreDx.vsix extension with Dapper ORM and FluentMigrator,Indentity Server 4 and/or JWT and XUnit project integration tests and Postman tests json file.

    Get the extension for only $6 CAD.

    Get the both extensions + REST API Python wrapper for $12 CAD

    More information about REST API Python wrapper here.

    Contact us

    Please use Paypal "Return to merchant" link after your payment in order to download VSIXs.

    You have 30 days to download the product using received link.

    If you have problems to download purchased VSIXs please contact us at apincore@anasoft.net and we will send you the download link.

    Note that no support is available for generated code with these VSIX extensions; however please let us know about suggestions, issues or improvements regarding solutions generated by the VS extensions.

    Thank you.
    ApiNCore team


    Extensions' icons thanks to cjdowner.

    Note that there is no restriction to use, copy, modify, and distribute software created with this Visual Studio extension template. Created solution using this template may contain code with unintentional flaws or limitations. Please adjust created solution to your needs and test it before any production use. IN NO EVENT SHALL OWNER OF THIS EXTENSION BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE OWNER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.