E
EDBrian
I am attempting to dynmically create a class that looks like this:
--------------------------------------
[Table(Name="ClientTable")]
public class ClientTable{
[Column(DbType = "VarChar(400) NOT NULL")]
public string FirstName { get; set; }
}
--------------------------------------
The problem that I am running into is creating the TableAttribute and
ColumnAttribute. How can I create these using the CustomAttributeBuilder?
Every example I see is similar to this one from MSDN:
http://msdn2.microsoft.com/en-us/library/system.reflection.emit.customattributebuilder.aspx
It creates the attribute and passes in the value to the constructor, because
that is how that attribute is defined. But when I look at the
TableAttribute it looks like this:
--------------------------------------
namespace System.Data.Linq.Mapping {
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited =
false)]
public sealed class TableAttribute : Attribute {
public TableAttribute();
public string Name { get; set; }
}
}
--------------------------------------
[Table(Name="ClientTable")]
public class ClientTable{
[Column(DbType = "VarChar(400) NOT NULL")]
public string FirstName { get; set; }
}
--------------------------------------
The problem that I am running into is creating the TableAttribute and
ColumnAttribute. How can I create these using the CustomAttributeBuilder?
Every example I see is similar to this one from MSDN:
http://msdn2.microsoft.com/en-us/library/system.reflection.emit.customattributebuilder.aspx
It creates the attribute and passes in the value to the constructor, because
that is how that attribute is defined. But when I look at the
TableAttribute it looks like this:
--------------------------------------
namespace System.Data.Linq.Mapping {
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited =
false)]
public sealed class TableAttribute : Attribute {
public TableAttribute();
public string Name { get; set; }
}
}