Entity Structure and Corporate Library

I am working on an asp.net project that a client gave me access to the database remotely.

There are two users in the database. One user has read-only access, where the other has access to the owner. The client says that for reading data we must use the first, and for inserting, etc. Use the second one.

In addition, the client told me to use stored procedures as much as possible, because there is a lot of data that will come from the db server. I want to use the Entity framework (edmx). Can I use stored procedures with it? Before the Entity framework, I used the corporate library for stored procedures. Do I need to go back and use it with stored procedures so that all database work is done on the db server side instead of transferring data to the web server using the entity infrastructure?

Also, how can I use one user for read-only purposes and another user to access the same db for insertion? Do I need to create two web configurations? Does it make the user read-only and get results faster?

If there is a better approach, please suggest me.

Please offer.

+1
source share
3 answers

You can use stored procedures with EF. But be careful, it is very difficult to get entities to work with stored procedures.

EF generates queries without writing sql statements; it generates SQL statements by observing changes in the entity. It just maps your objects to db tables. Therefore, if you have a table named "Item", it creates an "Item" object on the code side. You can manuplate the "Item" entity using the code and its associated EF methods to reflect the changes made to the entity in the database.

.

, , .

+1

Entity Framework . sql, db. () ef. ORM. Google ORMS.

Blair

0

, , , , , , , .

-, ? (, , ), , , . .

: http://www.codinghorror.com/blog/2004/10/who-needs-stored-procedures-anyways.html

: http://www.codinghorror.com/blog/2005/05/stored-procedures-vs-ad-hoc-sql.html

Usually, when people want to limit developers to using stored processes, they perceive benefits that are not real, and they don’t realize that they slow down the development process for no good reason. Not that stored procs are bad, but they have their own place, and it just doesn't make sense to have a rule that says they should be used as widely as possible.

0
source

All Articles