Questions tagged [columnattribute]
11 questions
4
votes
1 answer
Getting property value based on its column attribute value
List myModel1 = new List();
MyUserModel myUserModel = new MyUserModel();
List myModel2 = new List();
myModel1 = m_Service1.GetMyModelFields();
myUserModel =…

San
- 1,797
- 7
- 32
- 56
4
votes
2 answers
Get Column Name of entity
I'm using Entity Framework and here is what the metadata looks like for one of the tables.
[Column("pp_account")]
public string Account { get; set; }
[Column("pp_added")]
public DateTime? AddDate { get; set; }
…

Todd Miller
- 189
- 2
- 9
2
votes
1 answer
Object Mapping from stored procedure using the columnname attribute in EntityFramework CodeFirst
I have an existing db that I am using entityframework 6 Code-First on to work with. A requirement though is that all work with the db has to be via stored procedures. So I started out using the mapping that is new in…

Solmead
- 4,158
- 2
- 26
- 30
2
votes
1 answer
Mapping a URI to String-field in LINQ-to-SQL
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…

Jonas Lincoln
- 9,567
- 9
- 35
- 49
1
vote
2 answers
Do Buddy Classes only work for DataAnnotations?
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…

Alex
- 75,813
- 86
- 255
- 348
1
vote
1 answer
How do I get the ColumnAttributes from a Linq.Table?
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;
public MyDataContext(string connection) :…

Jeremiah
- 5,386
- 9
- 38
- 45
1
vote
1 answer
LINQ and ColumnAttribute
Can anyone please enlighten me why what the @_ means before the members of this object, as after 6 hours I am not any wiser. Many thanks
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="[_SessionID]", Storage="__SessionID",…

user1579546
- 11
- 1
0
votes
0 answers
Mapping a query column to property with the different name in LINQ. ColumnAttribute.Name does not work
I have a query that retrieves three columns from a table - ID, EMAIL_ID_NUMBER, and MESSAGE_SUBJECT. I want to map these three columns to the properties of an object ID, EMAIL_ID_NUMBER and MessageSubject (The names are chosen to highlight the…

Andrew
- 61
- 3
0
votes
3 answers
Trouble getting MemberName of "Name" from CustomAttributes = ColumnAttribute of Linq Table Class
I have a little algo I wrote to compare the Linq DataContext table to the sql table. It rolls through the properties of the Linq table and gets the CustomeAttributes of the property, (table columns). It's been working for years, but somebody…

Greg Kowieski
- 119
- 1
- 9
0
votes
0 answers
R: add value labels as an attribute to non-numeric columns
I have large number of data files that are either SPSS or text. When importing the SPSS files in R using read.spss from the library foreign, value labels are added automatically when using use.value.labels = TRUE. These are stored as a value.labels…

panman
- 1,179
- 1
- 13
- 33
-1
votes
1 answer
Linq To SQL context update - persist attibute parameter
Whenever a Linq data context is updated, all manually set attribute parameters are lost. I wonder if there is a way to persist them somehow? For instance, we need to persist an Auto Generated Value property represented by a IsDbGenerated attribute…

Andrei
- 55,890
- 9
- 87
- 108