These are templates for starting new NRSRx projects. These templates are fully compatible with Visual Studio 2022 and can also be used via the dotnet-cli.
- The latest dotnet SDK.
- Visual Studio 2022 (if you're planning to use Visual Studio)
At your closest command prompt, run the following:
dotnet new -i IkeMtz.NRSRx.Templates
The above command is also useful for pulling the latest version of the templates. It's ALWAYS a good idea to generate your projects off of the latest template.
You can either go through the steps within Visual Studio or use the following scripts.
Note: If the template can find a solution file (either in the same or parent folders), the generated projects will automagically be added to your solution.
dotnet new nrsrx-models -n {$Your Domain Name}.Models
dotnet new nrsrx-odata -n {$Your Domain Name}.OData
dotnet new nrsrx-odata-tests -n {$Your Domain Name}.OData.Tests
dotnet new nrsrx-webapi -n {$Your Domain Name}.WebApi
dotnet new nrsrx-webapi-tests -n {$Your Domain Name}.WebApi.Tests
These options should have the same value for the group of services generated for the same domain.
Short | Long | Default Value | Description |
---|---|---|---|
-S | --SkipModelGeneration | false | Use this option if you intent to use a Models project. |
-E | --EntityName | Item | Name of initial entity created within the project. |
-L | --LoggingProvider | ApplicationInsights | The type of logging provider that will be used (logging options below.) |
-D | --DatabaseProvider | MsSql | The type of database that will be used (db options below.) |
-Ev | --EventingProvider | ServiceBus | The type of eventing provider that will be used (eventing options below.) |
Note: this is not an option for Models projects.
Option |
---|
ApplicationInsights |
Splunk |
Elasticsearch |
NoLogging |
Note: this is not an option for Models projects. Additionally, OData and OData Test projects cannot utilize the NoDb option.
Option | Description |
---|---|
MsSql | Microsoft SQL Server |
MySql | MySql |
NoDb | No database |
Note: this option only applies to WebApi and WebApi Test projects.
Option | Description |
---|---|
Redis | Redis Streams |
ServiceBus | Azure ServiceBus |
NoEvents | No Eventing will be used |
NRSRx is an opinionated framework, which is also true for its templates. All domain/entity names should be in singular form.
Do:
Sample.Student.Models
Don't:
Sample.Students.Models
The following naming standards should also be observed:
- Model projects should end with a ".Models" suffix.
- OData projects should end with a ".OData" suffix.
- WebApi projects should end with a ".WebApi" suffix.
- Test projects should end with a ".Tests" suffix.