We help IT Professionals succeed at work.
Get Started

Entity Framework ExecuteFunction DBContext not refreshing entity?

sbornstein2
sbornstein2 asked
on
327 Views
Last Modified: 2015-05-19
Hello all,

I have a issue where I am using unit of work with entity framework.   When I add or update via a table entity then do a .Add then .Commit(). for example everything works beautifully.   Problem is not I am using a ExecuteFunction call with generic <T> to call a proc but the underlying table entity is not refreshed with that procs update to a record.  

        public ObjectResult<T> StoredProc<T>(string pName, params ObjectParameter[] pParams)
        {
            return ((IObjectContextAdapter)this.DbContext).ObjectContext.ExecuteFunction<T>(pName, pParams);
        }

Any idea how I refresh the underlying entity in this case?
Comment
Watch Question
Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE