I have several stored procedures which return a strongly typed result set. I've learned that Linq has its own method for handling that, which must be overwrote (or at least it seems that way).
My problem is Visual Studio insists on forcibly recreating stored procedures sometimes. I want to disable this.
Here is my manually modified file:
[Function(Name="dbo.spGetNote")]
public ISingleResult<Note> spGetNote([Parameter(DbType="Int")] System.Nullable<int> noteId, [Parameter(DbType="Int")] System.Nullable<int> securityUserId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), noteId, securityUserId);
return ((ISingleResult<Note>)(result.ReturnValue));
}
Here is what it defaults it to:
[Function(Name="dbo.spGetNote")]
public ISingleResult<spGetNoteResult> spGetNote([Parameter(DbType="Int")] System.Nullable<int> noteId, [Parameter(DbType="Int")] System.Nullable<int> securityUserId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), noteId, securityUserId);
return ((ISingleResult<spGetNoteResult>)(result.ReturnValue));
}
This is one of the smaller ones.
There are some other areas it messes with, but those are fixable. It gets real old going back and adjusting this.
What we've ended up doing is every stored procedure which returns its own strongly typed item is given it's own data context / class so that every time we update our DAL, it (Visual Studio) doesn't stomp on our custom changes.
Is there something I can do to help alleviate this headache?
What brought all this on is I'm going through cleaning up name spaces and I have found I can not change the namespace without Visual Studio ripping apart every single stored procedure in the project and I don't want to spend hours cleaning up that mess. Seemingly a global replace is not enough, as Visual Studio detects this and then says it can't find a conneciton string and must rebuild every single file involved.