SQLServerの何百ものストアドプロシージャを利用する大規模なコードベースを維持しています。未使用の手順を削除するには、まだ使用されている手順を見つける必要があります。SqlCommandに依存するすべてのメソッドを教えてくれるCQLを少し書きました。ほとんどの場合、このクラスの使用は、ウィザードで生成されたXSDによって実行されます。
/// <Name>Stored Procedure Usage</Name>
from m in JustMyCode.Methods
// Find usage of the property setter (principally XSD generated code)
let depth0 = m.DepthOfIsUsing("System.Data.Common.DbCommand.set_CommandText(String)")
// Find usage of the constructor (principally manual code)
let depth1 = m.DepthOfIsUsing("System.Data.SqlClient.SqlCommand..ctor(String,SqlConnection)")
where (depth0 >= 0 || depth1 >= 0)
select new { m, m.ParentType, m.ParentAssembly }
プロシージャ名は、インラインで定義され、SqlCommand.CommandTextに割り当てられた文字列です。
this._adapter.InsertCommand.CommandText = "dbo.InsertStudentAddress";
私の名前を印刷する方法はありますselect new {}
か?