Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/melardev/aspnetwebapicrud

Asp Net Web Api Crud application
https://github.com/melardev/aspnetwebapicrud

asp-net asp-net-mvc crud dotnet entity-framework full-stack scharp web-api web-api-2

Last synced: 1 day ago
JSON representation

Asp Net Web Api Crud application

Awesome Lists containing this project

README

        

- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Full-stack Applications](#full-stack-applications)
* [E-commerce (shopping cart)](#e-commerce-shopping-cart)
+ [Server side implementations](#server-side-implementations)
+ [Client side implementations](#client-side-implementations)
* [Blog/CMS](#blogcms)
+ [Server side implementations](#server-side-implementations-1)
+ [Client side](#client-side)
- [The next come are](#the-next-come-are)
* [Simple CRUD(Create, Read, Update, Delete)](#simple-crud-create--read--update--delete-)
+ [Server side implementations](#server-side-implementations-2)
+ [Client side implementations](#client-side-implementations-1)
- [The next come are](#the-next-come-are-1)
* [CRUD + Pagination](#crud--pagination)
+ [Server side implementations](#server-side-implementations-3)
- [The next come are](#the-next-come-are-2)
+ [Client side implementations](#client-side-implementations-2)
- [The next come are](#the-next-come-are-3)
- [Understanding the project](#understanding-the-project)
- [Social media links](#social-media-links)
- [Resources](#resources)

# Introduction
This is a project mean to be used for learning basic CRUD operations and Pagination using
- AspNet Web Api 2 (Not Asp Net Core, for the Asp Net Core I have another app, look links below)
- Entity Framework

# Full-stack Applications
## E-commerce (shopping cart)
### Server side implementations
- [Spring Boot + Spring Data Hibernate](https://github.com/melardev/SBootApiEcomMVCHibernate)
- [Spring Boot + JAX-RS Jersey + Spring Data Hibernate](https://github.com/melardev/SpringBootEcommerceApiJersey)
- [Node Js + Sequelize](https://github.com/melardev/ApiEcomSequelizeExpress)
- [Node Js + Bookshelf](https://github.com/melardev/ApiEcomBookshelfExpress)
- [Node Js + Mongoose](https://github.com/melardev/ApiEcomMongooseExpress)
- [Python Django](https://github.com/melardev/DjangoRestShopApy)
- [Flask](https://github.com/melardev/FlaskApiEcommerce)
- [Golang go gonic](https://github.com/melardev/api_shop_gonic)
- [Ruby on Rails](https://github.com/melardev/RailsApiEcommerce)
- [AspNet Core](https://github.com/melardev/ApiAspCoreEcommerce)
- [Laravel](https://github.com/melardev/ApiEcommerceLaravel)

The next to come are:
- Spring Boot + Spring Data Hibernate + Kotlin
- Spring Boot + Jax-RS Jersey + Hibernate + Kotlin
- Spring Boot + mybatis
- Spring Boot + mybatis + Kotlin
- Asp.Net Web Api v2
- Elixir
- Golang + Beego
- Golang + Iris
- Golang + Echo
- Golang + Mux
- Golang + Revel
- Golang + Kit
- Flask + Flask-Restful
- AspNetCore + NHibernate
- AspNetCore + Dapper

### Client side implementations
This client side E-commerce application is also implemented using other client side technologies:
- [React Redux](https://github.com/melardev/ReactReduxEcommerceRestApi)
- [React](https://github.com/melardev/ReactEcommerceRestApi)
- [Vue](https://github.com/melardev/VueEcommerceRestApi)
- [Vue + Vuex](https://github.com/melardev/VueVuexEcommerceRestApi)
- [Angular](https://github.com/melardev/AngularEcommerceRestApi)

## Blog/CMS
### Server side implementations
### Client side
#### The next come are
- Angular NgRx-Store
- Angular + Material
- React + Material
- React + Redux + Material
- Vue + Material
- Vue + Vuex + Material
- Ember

## Simple CRUD(Create, Read, Update, Delete)
### Server side implementations
### Client side implementations
#### The next come are
- Angular NgRx-Store
- Angular + Material
- React + Material
- React + Redux + Material
- Vue + Material
- Vue + Vuex + Material
- Ember
- Vanilla javascript

## CRUD + Pagination
### Server side implementations
- [Spring Boot + Spring Data + Jersey](https://github.com/melardev/SpringBootJerseyApiPaginatedCrud)
- [Spring Boot + Spring Data](https://github.com/melardev/SpringBootApiJpaPaginatedCrud)
- [Spring Boot Reactive + Spring Data Reactive](https://github.com/melardev/ApiCrudReactiveMongo)
- [Go with Gin Gonic](https://github.com/melardev/GoGinGonicApiPaginatedCrud)
- [Laravel](https://github.com/melardev/LaravelApiPaginatedCrud)
- [Rails + JBuilder](https://github.com/melardev/RailsJBuilderApiPaginatedCrud)
- [Rails](https://github.com/melardev/RailsApiPaginatedCrud)
- [NodeJs Express + Sequelize](https://github.com/melardev/ExpressSequelizeApiPaginatedCrud)
- [NodeJs Express + Bookshelf](https://github.com/melardev/ExpressBookshelfApiPaginatedCrud)
- [NodeJs Express + Mongoose](https://github.com/melardev/ExpressApiMongoosePaginatedCrud)
- [Python Django](https://github.com/melardev/DjangoApiCrudPaginated)
- [Python Django + Rest Framework](https://github.com/melardev/DjangoRestFrameworkPaginatedCrud)
- [Python Flask](https://github.com/melardev/FlaskApiPaginatedCrud)
- [AspNet Core](https://github.com/melardev/AspNetCoreApiPaginatedCrud)
- [AspNet Web Api 2](https://github.com/melardev/WebApiPaginatedAsyncCrud)

#### The next come are
- NodeJs Express + Knex
- Flask + Flask-Restful
- Laravel + Fractal
- Laravel + ApiResources
- Go with Mux
- AspNet Web Api 2
- Jersey
- Elixir

### Client side implementations
- [Angular](https://github.com/melardev/AngularPaginatedAsyncCrud)
- [React-Redux](https://github.com/melardev/ReactReduxPaginatedAsyncCrud)
- [React](https://github.com/melardev/ReactAsyncPaginatedCrud)
- [Vue + Vuex](https://github.com/melardev/VueVuexPaginatedAsyncCrud)
- [Vue](https://github.com/melardev/VuePaginatedAsyncCrud)

#### The next come are
- Angular NgRx-Store
- Angular + Material
- React + Material
- React + Redux + Material
- Vue + Material
- Vue + Vuex + Material
- Ember
- Vanilla javascript

# Understanding the project
I have controllers, services that deal with the database, Dtos that filter which thing is returned or not as response.
The controllers all return HttpResponseMessage, which is somewhat the old way, which means this code is more portable,
If for some reason you wanna return the new IHttpActionResult, it is easy, just wrap the HttpResponseMessage into ResponseMessage, the example
for the GetTodos Action in TodosController would be:

```csharp
public async Task GetTodos([FromUri] int page = 1, [FromUri] int pageSize = 5)
{
var result = await _todosService.FetchMany(page, pageSize, TodoShow.All);
return ResponseMessage(StatusCodeAndDtoWrapper.BuildSuccess(TodoListResponse.Build(result.Item2,
Request.RequestUri.LocalPath, page,
pageSize, result.Item1)));

}
```
More on this topic:
- [Why should I use IHttpActionResult instead of HttpResponseMessage](https://stackoverflow.com/questions/21758615/why-should-i-use-ihttpactionresult-instead-of-httpresponsemessage)
- [Action Results in Asp Net Web Api 2](https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/action-results)

I drop/create and seed database each time the app is run, this is not what we want for a more serious app, what we would want is to use migrations.
A really cool and simple guide can be found at official Microsoft docs(1min article read):
https://docs.microsoft.com/en-us/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-3

The next come are:
- NodeJs Express + Knex
- Flask + Flask-Restful
- Laravel + Fractal
- Laravel + ApiResources
- Go with Mux
- Jersey
- Elixir
# Social media links
- [Youtube Channel](https://youtube.com/melardev)
- [Blog](http://melardev.com)
- [Twitter](https://twitter.com/@melardev)

# Resources
- [Why Dtos are useful](https://docs.microsoft.com/en-us/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-5)
- [Bogus, the awesome Faker framework for .Net](https://github.com/bchavez/Bogus)
- [Create Entitis with Linq workaround](https://stackoverflow.com/questions/5325797/the-entity-cannot-be-constructed-in-a-linq-to-entities-query)