Reputation: 892
I plan to build website using asp.net mvc 5. But can't use databse direct in application as per my criteria. So now i have two ways, either use Web API or Class Library for database operation. Note that this website will have to many forms and have lots of database operations.
Please help me to get best decision. Thanks in advance.
Upvotes: 0
Views: 33
Reputation: 972
Create a second class library project in your solution, you would still need to do this even if you use WebAPI, encapsulate your database access code in the class library and reference it from your application project. This is encapsulation 101, look up repository pattern.
Upvotes: 1