I have in database a view named vue_demande
and I need to get all its rows in my application :
public IEnumerable<vue_demande> GetAllDemandes()
{
if ( context == null) context = GetContext();
return context.Set<vue_demande>().AsNoTracking <vue_demande>().ToList();
}
When I modify some values of tables of the view, it isn't refreshed!!!
I need to know :
I assume you are modifying values outside of your context. A context
will only ask the database for information that it doesn't already have. If you ask a context to get the same information again it'll just use the values it retrieved last time (this saves trips to the server).
To "refresh" just get a new context:
context = GetContext(); //Assuming your GetContext method returns a new context
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.