Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Over the weekend I have taken a course on ASP.NET Web API but I am struggling to understand where does it fit in terms of usage. Did some google research but still confused.

1. I can see it is good for implementing CURD operations on database but should I implement business logic in web api ?

2. Say I have a unit of work. Check customer exists in database and if so get the last 10 orders. Should this go in a single method in web-api or two methods one to check for customer and other to get orders ? So far I have seen examples implementing CURD on a single database resource.

3.If I have to imagine an application architecture using web-api i think

front end - in MVC
business logic - Separate Business Logic class library called from Controllers and it in turn call Web API ?
database logic - Use Web -API to implement CURD ?
Posted
Updated 24-May-15 17:04pm
v2

1 solution

In plain ASP.Net you would still follow MVC principles. Make classes to represent the data tables, middle classes to manage and query the data and the web pages to view them.

ASP.Net MVC does much of the hard work for you- under the hood.
I suggest you do one example of each and visit w3schools and MVC tutorials.
 
Share this answer
 
Comments
virang_21 24-May-15 23:33pm    
My questions are specific to ASP.NET web api not MVC in general.

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