Well, it may be a trivial for some but for me it was a half hour headache. Anywho, this is just a tip for anyone who has a multi language project, on how to declare partial classes and methods of your LINQ to SQL. Declaring a using namespace is not the way
to go, why I am not sure but it does not allow partial class in the syntax I did it in.
cscode.datacontext is the namespace of my .dbml file.
Email, is my table name. You will know it is working when you type in partial inside of public partial class Email { and you get intellisense.
Hope this helps anyone who had this problem.
namespace CSCode.DataContext
{
public partial class Email
{
// intellisense works
partial void OnCreated()
{
// do work?
}
}
}
Xequence
Contributor
4508 Points
1578 Posts
LINQ Partial Methods with Dual Language Project
May 04, 2011 07:46 PM|LINK
Well, it may be a trivial for some but for me it was a half hour headache. Anywho, this is just a tip for anyone who has a multi language project, on how to declare partial classes and methods of your LINQ to SQL. Declaring a using namespace is not the way to go, why I am not sure but it does not allow partial class in the syntax I did it in.
cscode.datacontext is the namespace of my .dbml file.
Email, is my table name. You will know it is working when you type in partial inside of public partial class Email { and you get intellisense.
Hope this helps anyone who had this problem.
namespace CSCode.DataContext { public partial class Email { // intellisense works partial void OnCreated() { // do work? } } }<codeSubDirectories> <add directoryName="VBCode" /> <add directoryName="CSCode" /> </codeSubDirectories>Credentials