Create and Learn REST API .NET and .NET Core solutions with Visual Studio extensions
RestApiN loading...
please wait

Your REST time is so precious!

So use this Visual Studio extension, lightweight and approachable, to create REST API solution with Blazor client driven by your specs, with code generated from enitities and take back your well deserved REST time...

Icon
Rest Time

Solid Structure

Visual Studio extension for building .NET based REST API services. Generated RestApin solution is built on three layers: Api, Domain and Entity and utilizing Automapper, DI, UnitOfWork, Generic Service and Repository with Entity Framework ORM, Sync and Async calls, Generic exception handler, Serilog logging with Console and File sinks, JWT authorization and authentication, API versioning.

Equipped

Generated REST API has integrated Swagger, XUnit test project, Postman API test with Powershell script and Newman to generate Postman reports, DDoS protection, Blazor test client, LazyCache caching, Concurent Dictionary safe-thread and Docker option for using images and containers for API. A great start for creating REST API service with all required plumbing based on latest .NET with Entity Framework or Dapper or Python.

Extendable

T4 templates are used for code scaffolding, generating 100's lines of code based on added base entity classes for: Domains, Services, Controllers, XUnit Tests, Postman tests json, Docker script and Blazor test client application with all layers. Add an entity class and generate all required code including passing XUnit tests, Postman tests, Blazor client code, Docker script...



How to quickly generate fully functional .NET REST API

with Visual Studio REST API extensions


RestApiNEx/RestApiNDx/RestApiPyEx are Visual Studio extensions for generating .NET/Dapper/Python based REST API services.

TESTIMONIALS

S.M. 2022-02-16
Hello guys, i bought your perfect REST API VS Template...
D.R. 2021-11-29
Thank you and congratulate you for an awesome plugin and project, it seriously simplifies things!
Guillaume B. 2021-11-08
Thanks for your nice API template, it's frankly a very good job.
I would recommend it, and I remain attentive to your future creations.
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.

Overview and updates

RestApiNEx is Visual Studio extension for building .NET based 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 with all required plumbing 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
  • API Swagger

Full version features:

  • includes all core features
  • T4 templates for code generation/scaffolding for:
    • Domain,
    • Service,
    • Controller,
    • Unit Tests,
    • Postman tests and
    • Blazor client test app
  • when added new entity classes (inherits from BaseEntity).
  • T4 project T4SmartCode with bat file CodeGeneratorUtility.bat to run all T4 templates,
  • Option between JWT or IdentityServer4 authorization/authentication with an OpenID Connect and OAuth 2.0 framework for ASP.NET Core.
  • Swagger and Swashbuckle IDL with ASP.NET Core to document/visualize/test generated REST API.
  • EF stored procedure example _unitOfWork.GetRepository().READbyStoredProcedure(sql, parameters);
  • XUnit integration tests (http client) run for the both authentication types: JWT or IS4 (only change appsettings).
  • Postman API tests script generated(JWT and IS4) for import as json file to Postman UI.
  • Postman API tests script generated(JWT and IS4) json file and executed with PowerShell script and Newman to generate/email html tests report.
  • DDoS attacks protection as an optional addition as .NET Core middleware - with custom API method attribute to protect specific REST API call.
  • Blazor test project connected to generated REST API
  • ConcurrentDictionary safe-thread option
  • LazyCache caching option for API service calls
  • Blazored.Toast JavaScript toast library
  • Docker option for using/images/containers for API, Blazor web client and database

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

Download full version of REST API VSIX

Extensions


RestApiNEx .NET 8:Latest version - .NET8 MS Long Term Support

  • Version 8.0.0 (.NET 8 - Initial) .NET Core 7.0 version upgraded to .NET 8.0 with others packages upgrades
  • Version 8.0.1 (.NET 8) .Added GraphQL library
  • NEXT (Add HTMX to web client test project connected to RESTAPI)
  • NEXT (Add scaffolding to build bicep scripts for Azure RESTAPI deployment driven by appsettings)
  • NEXT (Add scaffolding to .NET Maui client test project connected to RESTAPI)
NOTE: Visual Studio 2022 (v.17) required

RestApiNEx .NET 7:

  • Version 7.0.0 (.NET 7 - Initial) .NET Core 6.0 version upgraded to .NET 7.0
  • Version 7.1.0 Added scaffolding to .NET Blazor client test project connected to RESTAPI
NOTE: Visual Studio 2022 (v.17) required

RestApiNEx .NET 6:LTS version

  • Version 6.0.0 (.NET 6 - Initial) .NET Core 5.0 version upgraded to .NET 6.0
  • Version 6.0.1 (.NET6 specific minimal APIs implementation - Program.cs and integration tests)
  • Version 6.0.2 (Improve unit tests scaffolding - add mandatory entity fields)
  • Version 6.1.0 (Blazor client project based on generated REST API)
  • Version 6.2.0 (Refresh/Revoke JWT token and some refactoring)
  • Version 6.2.2 (ConcurrentDictionary safe-thread option addition)
  • Version 6.3.0 (LazyCache caching option addition)
  • Version 6.4.0 (Docker compose script)
  • Version 6.4.1 (Blazored.Toast JavaScript toast library)
  • Version 6.4.2 (Blazor client table pagination)
  • Version 6.5.0 (Add scaffolding to ,NET Blazor client project)
  • NEXT (Add scaffolding to build bicep scripts for Azure RESTAPI deployment driven by appsettings)
  • NEXT (Add scaffolding to .NET Maui client project)
NOTE: Visual Studio 2022 (v.17) required

RestApiNLx .NET 8 Light:

  • Version 8.0.0 - .NET 8 Light is very simplified basic REST API solution
NOTE: Visual Studio 2022 (v.17) required

RestApiNLx .NET 7 Light:

  • Version 7.0.0 - .NET 7 Light is very simplified basic REST API solution
  • Version 7.0.1 - (removed Startup.cs)
NOTE: Visual Studio 2022 (v.17) required

RestApiNLx .NET 6 Light:

  • Version 6.0.0 (.NET 6 - Initial) .NET 6 Light is very simplified basic REST API solution
NOTE: Visual Studio 2022 (v.17) required

RestApiNEx .NET 5:

  • Version 5.0.0 (.NET 5 - Initial) .NET Core 3.1 version upgraded to .NET 5.0
  • Version 5.0.1 (added db migration to T4 automation process)
  • Version 5.0.2 (added T4 automation to generate Postman tests for added entity/es))
  • Version 5.0.3 (DDoS attacks protection as .NET Core middleware - with custom attribute for REST API call)
  • ****NO MORE UPDATES/SUPPORT for .NET Core 5.0 vsix version****
NOTE: Visual Studio 2019 (v.16.8+) required

RestApiNLx .NET 5 Light:

  • Version 5.0.0 (.NET 5 - Initial) .NET 5 Light is very simplified basic REST API solution

NOTE: Visual Studio 2019 (v.16.8+) required

ApiNCoreEx .NET Core 3.1:LTS version

  • 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
  • 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)
  • Version 5.2 (added Powershell script to run Postman tests with Newman creating htlm reports and sending an email with attached reports)
  • Version 5.3 (added db migration to T4 automation)
  • Version 5.4 (added T4 automation to generate Postman tests for added entity)
  • ****NO MORE UPDATES/SUPPORT for .NET Core 3.1 vsix version****

ApiNCoreEx .NET Core 2.2:

  • 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)
  • ****NO MORE UPDATES/SUPPORT for .NET Core 2.2 vsix version****

Forum to post a question, propose new feature or a tip for other users

Code@Anasoft Forum

Instructions

1. Download and install full featured extension (VSIX).
2. Open Visual Studio and select new RestApiNE(x)/ApiNCoreE(x) (with ER ORM) solution template from Visual C# templates section.
3. After the solution is built and depencies automatically resolved - update DB connection in API and Test project (appseting.json file)
4. Run API project to start up REST API service and that initiates db migration and display the service the info page.
5. The service info/startup page has information about REST API service and the link to Swagger documentation/test page.
6. Run all unit tests in Test project.
7. The third way to test generated REST API service is either to import generated Postman json tests file to Postman UI or run PowerShell/Newman script to execute tests and generate/email html report tests results.
8. Set REST API and Blazor test project as start up and run the solution

Extending the service (T4 code generation/scaffolding) with added entity classes:

9. Create new entity classes (must inherit from BaseEntity) in Entity project, Entity folder.
10. To execute all T4 templates right-click on CodeGeneratorUtility.bat file(Entity project) and OpenWith command using PowerShell (may need to -Add...- PowerShell program).
IMPORTANT NOTE:Make sure when running T4 no other VS instances are open to avoid any reference conflict.
11. For added entity clases all supporting code (domain, services, API, Tests, db migration code) will be generated and new Postman json file with added tests.
12. Run API project to start up REST API and get info page. The same time db migration will be executed/deployed to the database.
13. Run all unit tests in Test project.
14. Run PowerShell/Newman script in Test/Postman to execute tests and generate/email html report tests results.

How to use IndentityServer4 as authentication service:

In order to use IndentityServer4 as authentication service for the API update the configuration file (appsettings.json) in API/Test project with this setting:
"Authentication":"UseIndentityServer4": true,
15. Run IdentityServer by righ-click IdentityServer project and "View/View in Browser" and wait for IS4 startup pages.
16. Run all unit tests in Test project.
17. Run REST API service by righ-click API project and "View/View in Browser" and wait for REST API startup pages.
18. In Test/Postman update config.txt by replacing JWT with IS4 (so only IS4 tests would run).
19. Run PowerShell/Newman script in Test/Postman to execute tests and generate/email html report tests results.
20. Go for a sleep, run, walk or...





.


Download full version of REST API VSIX

Code First or Database First

This extension is primary designed for "code first" approach however it can be used to build REST API code from existing database with some database modifications. These are basic steps required to connect RestApiNEx solution to existing database:
  • Create RestApiNEx with solution name the same as existing database name
  • Start created solution (so start up tables Account and User get created in the database)
  • Two options from here:
  • a) Manually create new entities (must subclasss BaseEntity) to match existing tables (step 2) and update existing table(s) structure with adding RestApi system columns (in yellow) or jusd recreate all tables with migration script
  • b) Use EF scafolding db script to scaffold enitities from existing tables (note that for more complex db structures it may not work for all tables so this argument can be used -Tables Table1,Table2)
    Scaffold-DbContext "Server=.\SQLExpress;Database=YourSolutionDBName;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entity -DataAnnotations -NoPluralize
  • All generated entities to be updated with subclasss BaseEntity; confirm code created in new db context
  • Run T4 scripts to generate REST API code (step 3)
  • Run new tests (step 4)
  • 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.
  • Automate Postman tests with Newman

    Postman tests with Newman :

    Generated solution contains adjusted Postman tests as json file (in Test project) ready for import and run in Postman application.

    The same folder has PowerShell script and instructions how to execute Postman tests json from command line using Newman (Node.js required) a command line collection runner. With the script generated htlm tests reports can be opened or emailed.

    DDoS attacks protection

    A Distributed Denial of Service attacks (or DDoS) overloads a network system, saturating the target machine with requests either slowing down traffic or blocking it completely. Firewalls have no intelligence on what business transaction is being performed so not always the best choice for DDoS attacks protection.
    Rest API solution generated by RestApiNEx Visual Studio extension provides optional DDoS atacks protection services with added a middleware extension for DDoS protection service.
    This is configuration settings for REST API DDoS attacks protection:
    "DDosAttackProtection": {
    "Enabled": true,
    "FullServiceLevelProtection": true,
    "MaxHitsPerOrigin": 100,
    "MaxHitsPerOriginIntervalMs": 1000,
    "ReleaseIntervalMs": 3600000
    }

    It means that all REST API calls are protected (FullServiceLevelProtection: true) and if 100+ request comes in 1 seconds from the same IP, the IP will be blacklisted and the response only set as HttpStatusCode.Forbidden. After one hour (3600 secs) blacklisted IP will be set as whitelisted.
    For selected REST API calls protection set FullServiceLevelProtection: false and flag selected REST API call/controller-method with this attribute [DDosAttackProtected] .
    Integration test is provided for DDoS attacks protection but Postman tests can used for testing DDoS attacks protection service with FullServiceLevelProtection: true settings and using multiple tests iterations.

    Docker

    Visual Studio Dockerfile and docker-compose added for for developing RestApiNEx solution with Docker images/containers for REST API services, BlazorTestWeb app and MS SQL database.
    Docker desktop must be installed.
    After initial solution created these steps are required before run docker-compose build/execute:
  • Close created solution
  • Run PowerShell script fixDockerConfiguration.ps1 located in *.Api solution project folder (this is workaround for Docker/VS issue locating VS solution files)
  • Run Docker desktop
  • Install required images
  • Open the solution
  • Set startup project as docker-compose and run the solution
    Note that the first run may take more time to download .net core 6 and sql db image as base images.
  • Publish to cloud computing platforms

    (NOTE: This is just information - no support by Code@Anasoft 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 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

  • Get full-featured VSIX extensions for Visual Studio


    (with T4 code generation for extending a solution; XUnit project integration tests; Postman/Newman tests, DDoS protection service, Blazor client)

    Get RestApiNEx(versions .NET 8, 7, 6 and 5), RestApiNLx(versions .NET 8, 7, 6 and 5) and ApiNCoreEx(.NET Core 3.1/2.2) 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
  • Optional authentication with 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 and PowerShell script for Newman tool to generate tests html report
  • T4 templates for code generation/scaffolding for Domain, Service, Controller, UnitTests, db migration script and Postman tests
  • DDoS attacks protection service
  • EF stored procedure option
  • Blazor test project connected to generated REST API
  • ConcurrentDictionary safe-thread option
  • LazyCache caching option for API service calls
  • Blazored.Toast JavaScript toast library
  • Docker option for using/images/containers for API, Blazor web client and database


  • Get all extensions for only $44 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 the whole package including:

  • RestApiNEx(versions .NET 8, 7, 6 and 5), RestApiNLx(versions .NET 8, 7, 6 and 5) and ApiNCoreEx (.NET Core 3.1/2.2) vxsix extensions with EF ORM and T4s ,
  • RestApiNDx (.NET 8.x), RestApiNDx (.NET 6.x), RestApiNDx (.NET 5) and ApiNCoreDx (.NET Core 3.1/2.2) vxsix extensions with Dapper ORM, FluentMigrator, Postman, Swagger, DDoS attacks protection and T4s
  • RestApiPyEx - Python REST API vsix extension (+wrapper) with flask,json,pyodbc,flasgger,swagger and db migration
  • BONUS: Google Drive JQuery plugin demo solution (quickly connect and use GDrive storage from JavaScript)
  • Get all extensions for only $66 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 code@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 from the date of the purchase.

    Thank you.
    code@Anasoft 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.