ApiNCore
loading...

ApiNCoreX - VS 2017/2019 REST API solution extension or How To Quickly Create REST API

Overview and updates

ApiNCoreEx is VS 2017/2019 extension for building .NET Core REST API services.
Generate 100s lines of code on a single click and save hours of searching Web and testing for the right REST API solution.
A great start for creating REST API service based on latest .Net Core.

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
  • API versioning

Full version extra features:

  • T4 templates for code generation/scaffolding for Domain, Service, Controller and UnitTests when added new entity classes (inherits from BaseEntity).CodeGeneratorUtility.bat
  • Option between JWT or IdentityServer4 authorization/authentication with an OpenID Connect and OAuth 2.0 framework for ASP.NET Core.
  • XUnit integration tests (http client) run for both authentication types: JWT or IS4 (only change appsettings).HttpClientFixture:IDisposable
  • Postman API tests script generated(JWT and IS4) for import as json file http://localhost:5000/api/account/{{account_addedid}}
  • Swagger and Swashbuckle IDL with ASP.NET Core to document/visualize/test generated REST API
  • EF stored procedure example _unitOfWork.GetRepository().READbyStoredProcedure(sql, parameters);

Download full version of this extension and save many hours searching for the right API REST solution!


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 (added time saving T4 template code generation for domain. service, controller and tests classes)
  • Version 3.4 (fix T4 template for code generation of tests classes)
  • Version 3.5 (db lazy loading)
  • Version 3.6 (Update unittests, add load test,add test appsettings for remote database and update Repository Update method)
  • Version 3.7 (DB concurrency for update, unittests refactored and updated)
  • Version 3.8 (Add predicate search examples service call)
  • Version 3.9 (Update/fix T4 template code)
  • Version 4.0 (Added CodeGeneratorUtility.bat to execute all T4s and updated Domain classes T4 script)
  • Version 4.1 (.NET Core 3.0 - Initial)
  • Version 4.2 (API versioning)
  • Version 4.3 (Added CodeGeneratorUtility.bat to execute all T4s and updated Domain classes T4 script)
  • Version 4.4 (Update to .NET Core 3.1 - LTS version )
  • Version 4.5 (Automapper v.9.0 with DI)
  • Version 4.6 (updated T4 templates for DI services and tests code generation)
  • Version 4.7 (updated to Swashbuckle.AspNetCore Version=5.0.0)
  • Version 4.8 (added an example of using stored procedures)
  • Version 4.9 (fixed the issue with using a dot in a solution name)
  • Version 5.1 (fixed the naming issues, updated solution's packages to the latest versions,IdentityServer4 updates)
  • NEXT (authenticate with Azure B2C, AWS Identity)

Reviews

M.D. 2020-10-02
Thanks for the good work. Your template was a perfect introduction into the API world.
George Bamber 2020-09-16
A great product that has really saved me hours and hours of work. Really looking forward to the IaaS support coming for AWS.
Doug Thompson 2020-03-30
Well worth the money even if 5 times the price - I would have paid more. Excellent videos which you great rarely even with paid for products - I can think of one that cost £80k/pa that has less videos and more bugs. Some suppliers think they are gods gift and you they pick you - they just highly paid sales men. Sure this product is just a good bit of well architected code driven by T4 - but just imagine how much time it saves you? Days? and still it is only a few dollars not $2500 Better get in there before they charge what the market can stand not how much time it too to develop.
Firyadi 2020-02-28
Sangat membantu sekali. Dengan sekali Clik, bisa menghemat waktu banyak, dengan minim kesalahan...
Helder Gabriel 2019-12-30
A great saving time template!!
Jairo Rodriguez 2019-11-13
This template saves me a lot of time in creating new API's with all the plumbing necessary for an API to run efficiently
Paul Whitworth 2019-07-10
This is an excellent template. It makes scaffolding a .NET Core API project painless and saves a lot of time.

Instructions

1. Download and install full featured extension (VSIX) (or free version).
2. Open Visual Studio and select new ApiNCoreE(x) (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 in connection string only "Data Source" (server name) in configuration file (appsettings.json) for API project and Test project(only full version):
"ConnectionStrings":"YourSolutionNameDB": "Data Source=CopyHereYourServerName;Initial Catalog=YourSolutionName;...",
5. Make sure that startup project is API and run Visual Studio solution which automatically initiates migration/seed services to get the API service info page. Note that by default JWT is used as authentication service for the API.
6. Test with Swagger API specification link using credentials my@email.com and mysecretpassword123 to get security token. The solution run triggers the database migration and data seed code which creates and populates initial tables.

In order to use IndentityServer4 as authentication service for the API, you can update configuration file (appsettings.json) in API project with this setting:
"Authentication":"UseIndentityServer4": true,

Extended VSIX version steps:

7. Set and save in configuration file (appsettings.json) in Test project connection string "Data Source" and authentication type JWT like:
"Authentication":"UseIndentityServer4": false,
8. Run all integration tests in Test project. It is used JWT as authetication service for the API.
9. Set and save in configuration file (appsettings.json) in Test project this setting:
"Authentication":"UseIndentityServer4": true,
10. Build the solution.
11. Run IdentityServer by righ-click on project IdentityServer and "View/View in Browser" and wait for IS4 startup page
12. Run all tests in Test project. It is used Indentity Server 4 as authetication service for the API.
13. Import Postman_tests_collection.json from Test project folder to Postman application.
14. Run JWT tests in Postman runner.
15. Set and save in configuration file (appsettings.json) in API project this setting:
"Authentication":"UseIndentityServer4": true,
16. Build the solution.
17. Run API and IS project the same time (use multiple startup project VS option)
18. Run IS4 tests in Postman runner.
T4 templates code generation/scaffolding:
  • Create new entity class (must inherit from BaseEntity) in Entity project, Entity folder,
  • To execute all T4 templates right-click on CodeGeneratorUtility.bat (Entity project) file and OpenWith command using PowerShell (may need to -Add...- PowerShell program) .
  • In order to execute manually use T4 template right-click on specific tt file and Run Custom Tool command.
  • If executing manually find end execute T4 templates in THIS order:
    1. Entity project 1_t4EntityHelpersGenerate.tt
    2. Domain project Domain folder 2_t4DomainViewModelsGenerate.tt
    3. Domain project Mapping folder 3_t4DomainMappingProfileGenerate.tt
    4. Domain project Service folder 4_t4DomainServicesGenerate.tt
    5. API project Controller folder 5_t4ApiControllerGenerate.tt
    6. API project Setup additions 5_t4ApiStartupAdditionsGenerate.tt
    7. Test project 6_t4IntegrationTestGenerate.tt
  • Use PM console (set Entity project as default one) to add new migration and update database (see commands in Entity project _nugets.txt for PM console)
  • Run all unit tests.
  • With these scaffolding routines, hundreds lines of code could be generated.

    Swagger API tests:

    Note that Swagger UI works in the latest versions of Chrome, Safari, Firefox, and Edge.(not IE)
    Set and save in configuration file (appsettings.json) in API project this setting to use JWT authentication:
    "Authentication":"UseIndentityServer4": false,
  • Run API service and click Swagger API specification button.
  • Find Token service (JWT), use Try it out button and enter these values (exists in test project code and match values in User table)):
    {
    "username": "my@email.com",
    "password": "mysecretpassword123"
    }

  • Execute Token service and copy returned token value: eyJhbGc...
  • Click Authorize button on the top of the Swagger page and add value Bearer eyJhbGc.... Click Authorize button.
  • All service calls are now authorized and can be tested.
    Download full version of VSIX
  • Publish to cloud computing platforms

    (NOTE: This is just information - no support by Apincore team would be provided on publishing to any cloud platform at this moment.
    Future versions of this extension may contain automated deployment to could platform and than such support would be avaliable)

    Microsoft Azure App Service
  • Create Azure service account Azure portal
  • Right click on your Apincore project in VS and use -Publish...- to link your created Azure account
  • How to perform configuration of your Azure account you can use these instructions
  • Right click on your Apincore project in VS and use -Publish...- to publish your service
  • Get your service url and add /api/info to the url to get start page of your Apincore service
  • For functional services create your database on your cloud premise and update connection string in appsettings.json of API project
  • To run integration tests localy against the published service must update appsettings-remote.json and in Test/IntegrationTest.cs set RemoteService = true and set tests credentials

  • Amazon AWS Service
  • Create AWS service account AWS portal
  • Download and install VS extension AWS Toolkit for Visual Studio 2017 and 2019 and setup your AWS account in installed extension
  • How to perform configuration of your AWS account you can use these instructions. This file aws-beanstalk-tools-defaults.json is added to your project.
  • Right click on your Apincore project in VS and use -Publish to AWS Elastic Beanstalk...- to publish your service
  • Get your service url and add /api/info to the url to get start page of your Apincore service
  • For functional services create your database on your cloud premise and update connection string in appsettings.json of API project
  • To run integration tests localy against the published service must update appsettings-remote.json and in Test/IntegrationTest.cs set RemoteService = true and set tests credentials

  • Google GCloud Service
  • Create GCloud service account GCloud portal
  • Download and install VS extension Google Cloud Tools for Visual Studio and setup your GCloud account in installed extension
  • How to perform configuration of your GCloud account you can use these instructions
  • Right click on your Apincore project in VS and use -Publish to Google Cloud...- to publish your service
  • Get your service url and add /api/info to the url to get start page of your Apincore service
  • For functional services create your database on your cloud premise and update connection string in appsettings.json of API project
  • To run integration tests localy against the published service must update appsettings-remote.json and in Test/IntegrationTest.cs set RemoteService = true and set tests credentials
  • Download full-featured VSIX extensions for VS2017 and VS2019
    (with time-saving T4 code generation; with XUnit project integration tests and Postman tests)

    Get two ApiNCoreEx.vsix (.NET Core 3.1 and .NET Core 2.2 version) extensions with these features :

  • Api, Domain, Entity and Test project
  • 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.
  • Swagger and Swashbuckle with ASP.NET Core
  • API versioning
  • XUnit integration tests (http client) run for both authentication types: JWT or IS4
  • Postman API tests (JWT and IS4) for import as json file
  • T4 templates for code generation/scaffolding for Domain, Service, Controller and UnitTests
  • EF stored procedure option


  • Get 2 extensions for only $24 CAD and save many hours to start with fully functional .NET Core REST API with all layers code scaffolding driven by added entity classes.
    Your time is priceless!

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

    Get
  • two REST API (ApiNCoreEx.vsix) with EF ORM and T4s (.NET Core 3.1 and .NET Core 2.2) xsix extensions,
  • two REST API (ApiNCoreDx.vsix) with Dapper ORM, FluentMigrator and T4s (.NET Core 3.1 and .NET Core 2.2) vsix extensions and
  • REST API Python wrapper vsix extension
  • BONUS: Google Drive JQuery plugin demo solution (quickly connect and use GDrive storage from JavaScript)
  • Get 5 extensions for only $36 CAD and save many hours to start with fully functional .NET Core REST API.

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

    More information about REST API with Dapper ORM and FluentMigrator here.

    More information about REST API Python wrapper here.

    Contact us

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

    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.

    We guarantee access to all updates of the product up to 6 months after the date of the purchase.

    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. The extension resell is forbidden! 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.