I have a use case like I have a school having two branches in two different cities like say one branch is in taxas and one is in dallas , Now I would like to have an API which would work two ways , Like when some student comes to get register him/her self in DALLAS then It will first check if the statudent ID already exists in TAXAS branch then it does not allow to enroll him in Dallas , and if someone come to TAXAS but if that student already exists in DALLAS then it should not allow him to enroll as it is two way process how I can achieve it
Loading
Sam HobbsPosted Dec 7, 2023, 9:54 PM
I do not know what Taxas is. Do you mean Texas or taxes? Note that Texas is a state. Dallas is a city in Texas.
PakeezaPosted Dec 7, 2023, 8:37 AM
thanks for all the responses Let me clear the picture .
Unfortunately I need to modify my question a bit, Like I need to have one API which would work for saving as well as passing the flag or a bit value to another school like say
DALLA: CAN ENROLL THE STUDENTS ONLY UPTO FIVE CLASS
TAXAS: CAN ENROLL THE STUDENT AFTER FIFTH CLASS LIKE 6,7,8
SO when some students comes to DALLAS the API need to check if it need to be enrolled less then five class then it wil enroll if not then it will return something so that the other side the TAXAS API consumer knows that its my student and they can enroll , how same api can be consumed at both school to achive this
PakeezaPosted Dec 7, 2023, 8:32 AM
Thanks Jayraj Chhaya for the response , my basic question was how two way communication can handle at the same time using web api like If I say the How this same API save the data at one use case and Pass the data to another school as second use case .
Satyaprakash SamantarayPosted Dec 7, 2023, 8:26 AM
You need to create web api and u can refer from here (https://tinyurl.com/4d64rk9w) and dulicate functionality Web API and for duplicacy need to create SP and there u need to put logic and make sp parameters as per ur table definitions. No need to create 2 branches u can do it under one web api controller and a table.
Jayraj ChhayaPosted Dec 7, 2023, 6:00 AM
To achieve the desired functionality, you can create a C# web API using the ASP.NET Core framework. Here's a step-by-step guide on how to implement the two-way enrollment process:
Set up the API project: Create a new ASP.NET Core Web API project in Visual Studio or your preferred development environment.
Define the data model: Create a Student class with properties like StudentId, Name, Branch, etc. This class will represent the student entity in your application.