-
Notifications
You must be signed in to change notification settings - Fork 14
Solution Templates
To make it easy to get started with Harmony Core development we provide several solution templates, each of which can be used to create a pre-configured development environment, each of which contains a Visual Studio solution and several projects.
The templates are distributed via a NuGet package called Harmony.Core.ProjectTemplates. You can download and install the templates by executing the following command:
dotnet new install Harmony.Core.ProjectTemplates
You can verify that the templates have been installed by typing:
dotnet new --list
This command displays a list of all of the templates that are installed in your environment, and you should see at least three Synergy templates listed:
Templates Short Name Language Tags
---------------------------------------------------------------------
Synergy EF Provider Solution efprovider Synergy Solution
Harmony Core Starter Solution harmonycore Synergy Solution
Harmony Core Demo Solution harmonydemo Synergy Solution
This is the main solution template that most developers will use when first starting out to develop a new Harmony Core service. It provides a pre-configured set of projects, with all of the required NuGet package references in place, but does not contain any pre-generated source code.
Specifically, the harmonycore
template provides:
-
A Visual Studio solution file.
-
A solution folder named
Solution Items
containing a CodeGen user-defined templates file and a batch file (regen.bat) containing the typical CodeGen commands that can be used to generate code to define, configure host, test, and document Harmony Core services. -
A solution folder named
Templates
containing the Harmony Core CodeGen templates that can be used to generate the code for services based on your repository. -
A repository project named
Repository
containing a sample repository schema file. In most cases, you will want to replace this schema with your own schema data. -
A .NET Core class library project named
Services
. This is where the core ASP.NET Web API and OData environments will be defined and configured. Initially, the project only contains a single folder namedwwwroot
that contains various files that present a simple home page that will be served by the webserver that hosts your services. -
A .NET Standard class library project named
Services.Controllers
where web service controller classes will be created. The project initially contains a couple of source files that are sometimes useful when building services. These files will be discussed in other areas of the documentation. -
A .NET Core console application project named
Services.Host
which is where code to "self-host" your services will be generated, if you select that option. -
A .NET Standard class library project named
Services.Isolated
. If you need to expose code that needs to be isolated from other instances of the same code then this is where you will define that code. -
A .NET Standard class library project named
Services.Models
. This is where the various data model and metadata classes will be generated for your services and also where the Entity Framework database context class that provides runtime access your data.
All of these projects have the necessary inter-project and NuGet package references in place and are ready for use.
In addition to the sample repository schema mentioned earlier, we also provide a folder named SampleData
that contains sequential data files and XDL files for the data used in the Harmony Core sample environment. This is to allow you to start building services from scratch using our sample environment. If you don't intend to do that then these files can be deleted.
This template creates an environment that is similar to that created by the harmonycore
template but includes the following additional components.
-
The
regen.bat
file is pre-configured to generate various web services based on the Harmony Core sample data, and the batch file has been executed to generate code for the environment. -
The
Services
project already contains various source files that are used to configure the sample services. Also, the HTML page in thewwwroot
folder has additional content, including various links to example operations for the sample services. -
The
Services.Controllers
project contains the code generated web service controllers for the various web services that are included in the environment. -
The
Services.Host
project contains various code that has been generated to self-host the sample web services that are defined in the other projects.
The Services.Models
project contains various code generated data model and metadata classes, as well as other code used to operate the services.
- An additional project named 'TraditionalBridge' that contains an example of how to implement a Harmony Core Traditional Bridge environment, essentially providing a way to expose Traditional Synergy subroutines and functions via a RESTful web services API. There is also additional code in the
Services.Models
andServices.Controllers
projects related to this, as well as additional custom startup code in theServices
project related to configuring the Traditional Bridge environment.
This template creates a solution that provides an example of how to use the Synergy EF Provider outside of a Harmony Core environment.
Additional documentation will be provided soon.
The Harmony Core solution templates can be removed from your system with the following command:
dotnet new -u Harmony.Core.ProjectTemplates
Next topic: Code Generation
-
Tutorial 2: Building a Service from Scratch
- Creating a Basic Solution
- Enabling OData Support
- Configuring Self Hosting
- Entity Collection Endpoints
- API Documentation
- Single Entity Endpoints
- OData Query Support
- Alternate Key Endpoints
- Expanding Relations
- Postman Tests
- Supporting CRUD Operations
- Adding a Primary Key Factory
- Adding Create Endpoints
- Adding Upsert Endpoints
- Adding Patch Endpoints
- Adding Delete Endpoints
-
Harmony Core Code Generator
-
OData Aware Tools
-
Advanced Topics
- CLI Tool Customization
- Adapters
- API Versioning
- Authentication
- Authorization
- Collection Counts
- Customization File
- Custom Field Types
- Custom File Specs
- Custom Properties
- Customizing Generated Code
- Deploying to Linux
- Dynamic Call Protocol
- Environment Variables
- Field Security
- File I/O
- Improving AppSettings Processing
- Logging
- Optimistic Concurrency
- Multi-Tenancy
- Publishing in IIS
- Repeatable Unit Tests
- Stored Procedure Routing
- Suppressing OData Metadata
- Traditional Bridge
- Unit Testing
- EF Core Optimization
- Updating a Harmony Core Solution
- Updating to 3.1.90
- Creating a new Release
-
Background Information