ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • How to read appSettings JSON from Class Library in ASP.NET Core
  • Printing Support In Asp.Net Core
  • Images Upload REST API using ASP.NET Core
  • How to use IActionFilter, IAsyncActionFilter in ASP.NET Core MVC?
  • ASP.NET CORE - Blazor CRUD operation using ADO.NET
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

Web API with ASP.NET Core

.Net .Net Core about 7 years ago || 8/16/2018 || 775 View

  • Hide

Web API (Application Programming Interface) is web development concept for either a Web Browser or Web Server. It’s usually limited to application's client-side for any web frameworks. Thus usually does not include web server or browser implementation details unless publicly accessible by a remote web application.

Steps for creating first Web API:

1. Create New ASP.NET CORE Web Application:

2. Select Web API:

3. Create Models folder in Web API Project

4.Add class in Models folder. Name it as APIModel

5. Define Data Parameters with data type in APIModel

6. Create new folder Repository

7. Add Interface class FirstInterface into Repository.

 

Define all the methods you want to implement using web api.

 

8.Add Repository class FirstRepository inside Repository.

Inherit interface class into Repository class and then by clicking quick actions, click implement. It will lead the Repository class to access all the methods you have defined inside interface. Inside those methods, write functions for CRUD operation or anything that you want to for the project. 

9. Create new folder APIController.

10.Add New APIController class into APIController folder

Now this APIController will act as the medium between the code and client side. Define the methods and just call the Repository class to use data manipulation functions. Now you can easily access the api controller by just calling the correct api method path.

 

  • 1
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Prakash Pokhrel

Prakash Pokhrel

https://np.linkedin.com/in/prakash-pokhrel-42a699a2

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey