views:

330

answers:

0

Hello.

Is there a way to generate a unique data contract namespace for generic types (similiar to data contract name) in C#?

I'd like to do something like this, where {0} in the namespace value would be replaced by the specific data type name.

[DataContract(Name = "DataResult_{0}", Namespace = "CommonTypes_{0}"]
public class DataResult <TDataType>
{
}

Thanks!