0

I know that from version 6 EntityFramework supports connection resiliency feature when working with SQL Azure database. I am pretty sure it applies to DbSet context members.

But what if I want to execute SQL query against the database like that:

context.Database.SqlQuery<User>("select * from Users");

Is it safe to perform this operation like that? Do I need to use any Retry frameworks here? I guess no, but I want to make sure.

0

1 Answer 1

1

Short version: Yes.

Long versions: The connection resilience is applied on the IDbConnection level. That direct sql query only generates a new IDbCommand that will be delivered to the sever by the same IDbConnection as all the others.

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

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.