public class DataColumnStructure : IGetData { [Column(Name = "id")] public int Id { get; set; } [Column(Name = "name")] public string Name { get; set; } [Column(Name = "description")] public string Description { get; set; } [Column(Name = "id_parent")] public int ParentId { get; set; } } public class MasterDataContext : DataContext { public IEnumerable<DataColumnStructure> GetColumns(int objectId) { return ExecuteQuery<DataColumnStructure> (GetColumns_Sql("sysCol.object_id = @p0"), new object[] {objectId}); } } 

Why does the Parent_id not want to be assigned at the specified [Column(Name = "id_parent")] ?
If you create a public int Id_Parent { get; set; } public int Id_Parent { get; set; } public int Id_Parent { get; set; } then everything is pulled out.

    1 answer 1

    I used this feature and did not encounter a similar problem. There is a thought that this is because of the underscore.

    I would recommend in the query explicitly specify SELECT id_parent AS ParentID FROM ...

    • this is not due to the underscore, when you refer to an object of type table, view, procedure, function, everything is pulled out as needed at the specified ColumnAttribute (name), but when you use ExecuteQuery, it simply does not look at the ColumnAttribute and compares the properties themselves regardless of the ColumnAttribute . Perhaps this is a small bazhik, and maybe it was conceived :)). We'll have to call the properties as selected fields but ColumnAttribute. - Acne