I'm trying to return attributes of columns from my DataContext.
How can I pull out the ColumnAttribute meta data?
public class MyDataContext : DataContext
{
public Table<User> User;
public MyDataContext(string connection) : base(connection) { }
}
[Table(Name = "User")]
public class User
{
[Column(IsPrimaryKey = true)]
...
I'm trying to store a URI as a string in a database, using LINQ.
[Column(Name = "Url", DbType = "nvarchar(255)")]
public Uri Url
{
get
{
return new Uri(_url);
}
set
{
_url = value.AbsoluteUri;
}
}
private string _url;
This maps nicely to my database design, however, when trying to fetch data u...
Do buddy classes only work for dataannotations, or for any attribute? I've been trying to attach a ColumnAttribute to a field in my buddy class, but it appears that it doesn't get processed in the original class. The two classes are linked via MetadataType.
...