EF Update, database value changes, foreground page does not change, refresh does not change, rerun program changes----problems encountered in development (resolved)

Source: Internet
Author: User

First, let's say the code scenario where I'm experiencing this situation, first the error code

UserInfo UserInfo = session["UserInfo"asvar0);

The problem with this code is that the database value changes, the foreground page does not change, the refresh does not change, and the re-run program changes.

Breakpoint debugging----See any updates, the contents of the Attentiontopicinfos have not changed.

Finally think of----userinfo is removed from the session, session Stored user login information, content does not query update.

And the Topicinfos we need is the navigation property, the content of this attribute, also in the session.

Modify Code

UserInfo UserInfo = session["UserInfo" as UserInfo;   = _userinfoservice.getentitesqueryable (U = u.userguidid = = Userinfo.userguidid). First ();//re-query UserInfovar0);

Successfully resolved to this issue. The solution is simple, but I believe the development will often encounter, and I do not search for any relevant articles in the problem,

So here to share with you.

EF Update, database value changes, foreground page does not change, refresh does not change, rerun program changes----problems encountered in development (resolved)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.