Skip to content

VBDev2Dev/ContactsSampleAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASP .Net Core API project Sample

Set up

  1. Create a Database on Local db called ContactsAPISample
    1. View-> Sql Server Object Explorer in Visual Studio
    2. Add (localdb)\MSSQLLocalDB server if it does not exist
    3. Right click databases node under (localdb)\MSSQLLocalDB
    4. Add New database called ContactsAPISample
  2. Go to .Net Core 2.1 downloads and install the latest sdk and Runtime & Hosting Bundle
  3. Right click Solution and choose Restore Nuget Packages
  4. Open Package manager console in visual studio Tools-> Nuget Package Manager-> Package Manager Console
  5. Run Update-Database

Running

Press F5. You will see a swagger page show. This will allow you to play with the different endpoints.
Create a contact (POST) and then run the other api end points. Try things like invalid input, duplicate email addresses, Birthdate in future.

Things to be aware of

This is a quick and dirty and not how I would create a good api. See below

  • I did not use automapper and create API models to translate back and forth between enity framework and api models.
  • I did not create a controller for email addresses.
  • I did not use odata to allow the client to control things like filtering and such

About

C# .net Core API project start

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages