Skip to content

CiBuildOrg/WebApi-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Api boilerplate

This will serve as a general base for creating a backend project in .NET

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You need Visual Studio 2017 to compile this. NuGet will take care of the rest.

Installing

Pull the repo, open it in Visual Studio and enable NuGet package restore. I assume you gave your database the name GenericDb. If this is not the case, please change it accordingly in web.config and also in the ContextFactory class.

Generate your sql migration script like so:

Update-Database -ConfigurationTypeName ContextConfiguration -Script -Verbose -ConnectionString "Data Source=.;Initial Catalog=GenericDb;Integrated Security=True;" -ConnectionProviderName "System.Data.SqlClient" -StartupProjectName App.Api -ProjectName App.Database

This will generate a SQL script that you can then run against your database. In case you modify the database entities you can always add a migration like so:

Add-Migration -Verbose -ConfigurationTypeName ContextConfiguration -ConnectionString "Data Source=.;Initial Catalog=GenericDb;Integrated Security=True;" -ConnectionProviderName "System.Data.SqlClient" MigrationNameHere -StartupProjectName App.Api -ProjectName App.Database

Running the tests

Comming up.

Deployment

More to come. Will contain a build script capable of deploy using Cake.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details