English 中文(简体)
Linq-To-Sql ClearCache() 方法 Ok to calls?
原标题:Linq-To-Sql ClearCache() Method - Ok to call?

我想能够澄清数据库的切身之处,以便查明目前跟踪情况的实体。 该背景标有清晰可见的方法,但属于内部。 我写了以下法典,称这种方法:

private void ClearContextCache()
{
    const BindingFlags FLAGS = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
    var method = this.GetType().GetMethod("ClearCache", FLAGS);
    method.Invoke(this, null);
}

这种方法进行罚款。 但是,我担心的是,清除环境海滩是否是安全的事情。 我认为,为什么微软的L2S建筑师想要采用这种方法的开发商。 人人都有这方面的经验?

丰田

问题回答

暂无回答




相关问题
LINQ to SQL as databinding source for WPF Treeview

I wonder if someone could provide a simple example of the following. (preferably in VB.Net): I have an SQL database with related tables and I am successfully using LINQ to SQL in other areas of my ...

Linq to SQL insert/select foreign/primary records

I have table A and Table B. Table B contains two columns, Name and ID. Table A contains several columns and a foreign key column pointing to B.ID called B_ID On the client side, I have all the data I ...

LINQ to SQL Dynamic Sort question

How do I code the Select clause in my LINQ satament to select column aliases so I can sort on them basically I want to accomplish this SQL statement in LINQ: select type_id as id, ...

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签