Using namespace in LINQPad code (C# Program mode)
I try to use a namespace in code I have in LINQPad. I want to define a namespaced class I have to use in a call.
Something like:
void Main()
{
Query();
}
namespace MyNamespace
{
public class SyncList
{
public string Id { get; set; }
}
}
So I don't want to reference an assembly. Is this possible?
Regards,
Serge
Something like:
void Main()
{
Query();
}
namespace MyNamespace
{
public class SyncList
{
public string Id { get; set; }
}
}
So I don't want to reference an assembly. Is this possible?
Regards,
Serge
Comments
Why would you want to do that? Could you use an inner class instead? Regards,
Arno
And, FYI, we don't need the
}
class EOF {
Just keep the namespace open (i.e. without the closing brace } and it works great.
Still helpful in 2023, my man jwstevensii is a legend!
I presume you're using LINQPad 5? This hack is not necessary in LINQPad 7.