Giter Site home page Giter Site logo

scribbio / dotnet-8-crud-web-api-example Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 10 KB

ASP.NET Core 8 Web API demonstrating CRUD operations with Entity Framework Core and SQLite. A practical example for managing movies data.

License: MIT License

C# 100.00%

dotnet-8-crud-web-api-example's Introduction

DotNet Crud Web Api Example

A RESTful Web API using ASP.NET Core in .NET 8.0 alongside Entity Framework Core.

This project demonstrates a simple CRUD (Create, Read, Update, Delete) operation on movies, utilizing a SQLite database to persist data.

Prerequisites

Before you begin, ensure you have the following installed:

  • .NET 8.0 SDK
  • Entity Framework Core CLI

You can install the EF Core CLI tool globally using:

dotnet tool install --global dotnet-ef

Getting Started

To get a local copy up and running follow these simple steps:

  1. Clone the repository

    git clone https:/github.com/Scribbio/DotNet-8-Crud-Web-API-Example.git
  2. Navigate to the project directory

    cd DotNetCrudWebApi
  3. Install necessary packages

    Make sure all the required NuGet packages are restored:

    dotnet restore
  4. Run Migrations

    Apply the database migrations to set up your database schema:

    dotnet ef database update

    If your EF Core context and migrations are in a different project, specify the projects as follows:

    dotnet ef database update --project YourEFCoreProject --startup-project YourStartupProject

Usage

Start the API locally by running:

dotnet run

Your API will be available at http://localhost:5000 by default.

API Endpoints

The following endpoints are available:

  • GET /api/Movies: Retrieves a list of all movies.
  • GET /api/Movies/{id}: Retrieves a specific movie by its ID.
  • POST /api/Movies: Adds a new movie.
  • PUT /api/Movies/{id}: Updates an existing movie.
  • DELETE /api/Movies/{id}: Deletes a specific movie.

License

Distributed under the MIT License. See LICENSE for more information.

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.