Skip to content

Exemple of Async Verbs Using Entity Framework with the patterns UnitOfWorks and Repository

Notifications You must be signed in to change notification settings

JoelBrito13/StoreExample

Repository files navigation

StoreExample

Example of RESTFul API written in ASP.NET Core 2.2 using:

  • Async Verbs
  • Entity Framework
  • UnitOfWorks + Repository.
  • SQL Server

All the Methods should be Testing using the termination URL: /swagger/index.html

To test in your local environment, just change the ConnectionStrings inside the appsettings.json to receive the DataBase

Example of Database Creation

	CREATE DATABASE demo;
	USE demo; ***

	CREATE TABLE Category(
		Idx INT IDENTITY(1,1) PRIMARY KEY,
		Name VARCHAR(50));

	CREATE TABLE Product(
		Idx INT IDENTITY(1,1) PRIMARY KEY,
		Name VARCHAR(50),
		Price FLOAT,
		CategoryIdx INT REFERENCES Category(Idx) ON DELETE CASCADE);

	INSERT INTO Category(Name) VALUES ( 'Eletronics');
	INSERT INTO Category(Name) VALUES ( 'Warehouse');

	INSERT INTO Product(Name, Price, CategoryIdx) VALUES ('Dell Inspiron', 11222.22, 1);
	INSERT INTO Product(Name, Price, CategoryIdx) VALUES ('Asus VivoBook', 113.22, 1);
	INSERT INTO Product(Name, Price, CategoryIdx) VALUES ('MacBook', 1.99, 1);
	INSERT INTO Product(Name, Price, CategoryIdx) VALUES ('LG Smart TV', 2.52, 2);

	SELECT * FROM Category;
	SELECT * FROM Product;

Credits

Repository Patern + UnitOfWor: https://www.programmingwithwolfgang.com/repository-and-unit-of-work-pattern/

About

Exemple of Async Verbs Using Entity Framework with the patterns UnitOfWorks and Repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages