I updated dotConnect for Oracle DB from 6.50.228.0 to 8.4.359.0
Here's dbContext:
Code: Select all
public class TypeTreeDataContext : DataContext
{
public TypeTreeDataContext(OracleConnection conn) : base(conn) { ObjectTrackingEnabled = false; }
public TypeTreeDataContext(OracleConnection conn, Devart.Data.Linq.Mapping.XmlMappingSource source) : base(conn, source) { ObjectTrackingEnabled = false; }
public Table<SysFilterCriterion> SysFilterCriterions;
}
Code: Select all
[Table(Name = "SYS$FILTER_CRITERIONS")]
public class SysFilterCriterion
{
long _No;
[Column(Name = "NO", Storage = "_No", IsPrimaryKey = true)]
public long No { get { return _No; } }
long _FilterNo;
[Column(Name = "FILTER_NO", Storage = "_FilterNo")]
public long FilterNo { get { return _FilterNo; } }
int? _OrderNo;
///<summary>Порядковый номер</summary>
[Column(Name = "ORDER_NO", Storage = "_OrderNo")]
public int? OrderNo { get { return _OrderNo; } }
long? _FieldNo;
///<summary>Поле (ссылка на tdf$fields или tdf$blocks)</summary>
[Column(Name = "FIELD_NO", Storage = "_FieldNo")]
public long? FieldNo { get { return _FieldNo; } }
string _Caption;
///<summary>Заголовок</summary>
[Column(Name = "CAPTION", Storage = "_Caption")]
public string Caption { get { return _Caption; } }
string _WithoutTime;
///<summary>Поиск по полю без учета времени</summary>
[Column(Name = "WITHOUT_TIME", Storage = "_WithoutTime")]
public string WithoutTime { get { return _WithoutTime; } }
}
When try to resolve SQL-query through Linq
Code: Select all
using (OracleConnection con = new OracleConnection() { UserId = "UserID", Password = "PSW", Server = "SERVER"})
{
con.Open();
TypeTreeDataContext context = new TypeTreeDataContext(con);
var crits = context.GetTable<SysFilterCriterion>()
.OrderBy(c => c.OrderNo)
.Select(c => new
{
No = c.No,
FieldNo = c.FieldNo,
Caption = c.Caption
}).ToList();
IEnumerable<long> nos1 = crits.Select(c => c.No);
con.Close();
}
cannot Transform Devart.Data.Linq.Engine.ObjectReader`1[<>f__AnonymousType0`3[System.Int64,System.Nullable`1[System.Int64],System.String]]" to type "System.Collections.Generic.IEnumerator`1[<>f__AnonymousType0`3[System.Int64,System.Nullable`1[System.Int64],System.String]]
Where's error?
if i resolve query with all columns such as
Code: Select all
var crits = context.GetTable<TypeTreeMapping.BaseClasses.Kernel.T93.SysFilterCriterion>()
.OrderBy(c => c.OrderNo).ToList();
Thanks.