0

I was wondering if is it possible to create a Web API without Entity Framework.

This should be strange but supposing to have this table

T_BOOKS:

BookId int
BookTitle nvarchar(50)

and a stored procedure that returns me something like that

select BookId, BookTitle 
from T_BOOKS

Then I add a column to both the table and the stored procedure

T_BOOKS:

BookId int
BookTitle nvarchar(50)
BookAuthor nvarchar(50)

select BookId, BookTitle, BookAuthor 
from T_BOOKS

Why should I change the controller and redeploy entire WebAPI ?

Any answer is appreciated.

Many thanks!

2 Answers 2

2

WebAPI and Entity Framework are two different technologies. One is a framework to provide easy to create HTTP services while other is a Framework for data access.

You, of course, can provide data to a Web API with any data provider you like. Entity Framework is a choice while, ADO.NET, NHibernate and other technologies may be other choices.

Sign up to request clarification or add additional context in comments.

Comments

2

Entity Framework is not necessary for Web API. You can retrieve and return the data using any method you prefer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.