none
DBContext.CommandTimeout does not compile in .net 4.5 Entity framework 5 RRS feed

Answers

  • Hi Arne,

    The CommandTimeout that you are linking to is for ObjectContext not DbContext.

    If you want to set the command timeout on a DbContext based model then you need to use the IObjectContextAdapter interface.

    There is a blog post that describes how to use IObjectContextAdapter to get access to ObjectContext from a DbContext here: http://thedatafarm.com/blog/data-access/accessing-objectcontext-features-from-ef-4-1-dbcontext/

    Once you have the object context then you can set the command timeout there.


    We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.

    Tuesday, September 11, 2012 6:03 PM
    Moderator

All replies

  • Hi Arne,

    The CommandTimeout that you are linking to is for ObjectContext not DbContext.

    If you want to set the command timeout on a DbContext based model then you need to use the IObjectContextAdapter interface.

    There is a blog post that describes how to use IObjectContextAdapter to get access to ObjectContext from a DbContext here: http://thedatafarm.com/blog/data-access/accessing-objectcontext-features-from-ef-4-1-dbcontext/

    Once you have the object context then you can set the command timeout there.


    We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.

    Tuesday, September 11, 2012 6:03 PM
    Moderator
  • That compiles and runs on .net 4.5 EF5.

     


    • Edited by Arne MN Tuesday, September 11, 2012 8:04 PM
    Tuesday, September 11, 2012 8:01 PM