Giter Club home page Giter Club logo

asp.net-webapi's Introduction

ASP.NET-WebAPI

WebAPI for CRUD operations of library client app built with C# ASP.NET (.NET Framework 4.8). This API interacts with library's database via Entity Framework.

API Methods

Books controller

API Description
GET api/Books Gets list of Books from the server
GET api/Books/{id} Gets the book by Id from the server
POST api/Books Adds the book to the server
DELETE api/Books/{id} Deletes the book by Id
PUT api/Books Updates the book data on the server

Users controller

API Description
GET api/Users Gets list of users from the server
GET api/Users/{id} Gets the user by Id
POST api/Users Adds user to the server
DELETE api/Users/{id} Deletes user by Id
PUT api/Users Updates user's data

UserBooks controller

API Description
GET api/UserBooks Gets list of records (books that were taken by users) from the server
POST api/UserBooks Adds user-book record to the server
PUT api/UserBooks Updates user-book record
DELETE api/UserBooks/{id} Deletes user-book record by id

Database

Database file is in Database/ folder.
It has 3 tables:

  1. Users
    CREATE TABLE [dbo].[Users] (
     [Id]          INT            IDENTITY (1, 1) NOT NULL,
     [FullName]    NVARCHAR (50)  NOT NULL,
     [DateOfBirth] DATE           NULL,
     [Address]     NVARCHAR (255) NULL,
     [Email]       NVARCHAR (255) NOT NULL,
     [Phone]       NVARCHAR (20)  NULL,
     PRIMARY KEY CLUSTERED ([Id] ASC) );
  2. Books
    CREATE TABLE [dbo].[Books] (
     [Id]          INT            IDENTITY (1, 1) NOT NULL,
     [Name]        NVARCHAR (255) NOT NULL,
     [Author]      NVARCHAR (255) NOT NULL,
     [Description] NVARCHAR (MAX) NULL,
     [PrintDate]   DATE           NULL,
     [Quantity]    INT            NULL,
     PRIMARY KEY CLUSTERED ([Id] ASC) );
  3. UserBooks -
    CREATE TABLE [dbo].[UserBooks] (
     [UserBookID]   INT  IDENTITY (1, 1) NOT NULL,
     [UserID]       INT  NOT NULL,
     [BookID]       INT  NOT NULL,
     [CheckoutDate] DATE NULL,
     [ReturnDate]   DATE NULL,
     PRIMARY KEY CLUSTERED ([UserBookID] ASC),
     FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([Id]),
     FOREIGN KEY ([BookID]) REFERENCES [dbo].[Books] ([Id]) );

asp.net-webapi's People

Contributors

d1lsh0d avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.