https://github.com/sonujose/coreapplication_reference
Core application with ef core, in-memory
https://github.com/sonujose/coreapplication_reference
Last synced: 2 months ago
JSON representation
Core application with ef core, in-memory
- Host: GitHub
- URL: https://github.com/sonujose/coreapplication_reference
- Owner: sonujose
- Created: 2018-10-28T06:03:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-28T06:05:03.000Z (over 7 years ago)
- Last Synced: 2025-01-02T01:45:01.184Z (over 1 year ago)
- Language: C#
- Size: 2.54 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# ASP.NET Core WebApi Sample with HATEOAS, Versioning & Swagger
In this repository I want to give a plain starting point at how to build a WebAPI with ASP.NET Core.
This repository contains a controller which is dealing with FoodItems. You can GET/POST/PUT/PATCH and DELETE them.
Hope this helps.
See the examples here:
## Versions
``` http://localhost:29435/swagger ```

## GET all Foods
``` http://localhost:29435/api/v1/foods ```

## GET single food
``` http://localhost:29435/api/v1/foods/2 ```

## POST a foodItem
``` http://localhost:29435/api/v1/foods ```
```javascript
{
"name": "Lasagne",
"type": "Main",
"calories": 3000,
"created": "2017-09-16T17:50:08.1510899+02:00"
}
```

## PUT a foodItem
``` http://localhost:29435/api/v1/foods/5 ```
``` javascript
{
"name": "Lasagne2",
"type": "Main",
"calories": 3000,
"created": "2017-09-16T17:50:08.1510899+02:00"
}
```

## PATCH a foodItem
``` http://localhost:29435/api/v1/foods/5 ```
``` javascript
[
{ "op": "replace", "path": "/name", "value": "mynewname" }
]
```

## DELETE a foodItem
``` http://localhost:29435/api/v1/foods/5 ```
