Click here to Skip to main content
15,921,210 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My requirements are

1.create API to get the user information(JSON request as given in below) from other system, update those information to database.
2.After update want to send the JSON response(model is given below) back.


I'm using entity framework model. I want to build the API to meet the mentioned requirements, please help me

My controller:
namespace CT.API.User
{
    public class UserController : CTControllerBase
    {
        //API
        [AllowAnonymous]
        public JsonResult USerApiTest()
        {
            // to handle the code
       }
    }
}

Request Details:
{"REQLEN":4,"REQDTL":[{"ID":"48490","UserName":"Test1","Password":"Test1"},{"ID":"48491","UserName":"Test2","Password":"Test2"}]}

Reponse Details:
{"RESLEN":4,"RESDTL":[{"ID":"48490","Status":"Success"},{"ID":"48491","Status":"Fail"}]}


What I have tried:

I'm new to API and want to build the API to meet the mentioned requirements, please help me with the code
Posted
Updated 24-Aug-17 14:49pm

1 solution

Here is a good place for beginners like you to start: Getting Started with ASP.NET Web API 2 (C#) | Microsoft Docs[^] and here: ASP.NET Web API | The ASP.NET Site[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900