When using dbml autogeneration in a visual studio, a stored procedure call usually ends this way
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="MYDB.ui_index_group_upd")] public int ui_index_group_upd([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="Int")] System.Nullable<int> group_id, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="VarChar(32)")] string group_code) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), group_id, group_code); return ((int)(result.ReturnValue)); }
and itβs usually called like that ...
using (var db = new L2SDataContext(base._connectionString)) { var result = db.ui_index_group_upd(1, "foo"); }
Everything is good.
However, what I am trying to achieve is a global way of capturing errors and reporting all such method calls in such a way as to record the proc name and values ββfor all parameters passed in case of a problem
I would prefer not to write code code for each method and, for obvious reasons, I do not want to change the autogen code.
I am thinking of a layer between my call and the dbml method, but I, although maybe someone faced a similar problem, so I thought I put it there before spending time messing up until I get a reasonable answer, I I think the trick is an elegant way of listing parm and the name proc, etc.
I hope this makes sense, all reviews are rated
source share