Skip to content

ikemtz/NRSRx-Templates

Repository files navigation

Build Status Release Status Nuget Package Nuget Downloads

NRSRx Templates

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.

Requirements

  • The latest dotnet SDK.
  • Visual Studio 2022 (if you're planning to use Visual Studio)

Getting started

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.

Generating new projects via dotnet cli scripts

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.

Scripting a models project:

dotnet new nrsrx-models -n {$Your Domain Name}.Models

Scripting an OData project

dotnet new nrsrx-odata -n {$Your Domain Name}.OData

Scripting an OData Test project

dotnet new nrsrx-odata-tests -n {$Your Domain Name}.OData.Tests

Scripting a WebApi project

dotnet new nrsrx-webapi -n {$Your Domain Name}.WebApi

Scripting a WebApi Test project

dotnet new nrsrx-webapi-tests -n {$Your Domain Name}.WebApi.Tests

Options

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.)

Logging Options

Note: this is not an option for Models projects.

Option
ApplicationInsights
Splunk
Elasticsearch
NoLogging

Db Options

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

Eventing Options

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

Naming Standards

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.

About

Templates for starting new NRSRx projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published