I have Devart.Data.Linq 4.4.697.0, Devart.Data.Oracle.Linq 4.4.697.0, Devart.Data.Oracle. 8.4.359.0 and use MS VS 2013 Ultimate, C#. Last week I upgraded versions of Devart.Data.Oracle from 6.50.228.0 to 8.4.359.0, Devart.Data.Linq from 3.0.5.0 to 4.4.697.0 and Devart.Data.Oracle.Linq from 3.0.5.0 to 4.4.697.0.
I faced to problems by executing a Linq queries in my WebSite which appeared in the following code:
Code: Select all
var data = (from c in All.SysFilterCriterions
select
new MyCriterion()
{
No = c.No,
FieldNo = c.FieldNo,
Caption = c.Caption,
IsLocalField = c.FieldNo == c.E_FilterNo.BlockNo || c.E_FieldNo_51.BlockNo == c.E_FilterNo.BlockNo
})
.ToList();
Code: Select all
public partial class Core_Pages_FlatHandbookFilter : Page
{
..........
public void func()
{
// here is linq query code
}
public class MyCriterion
{
public long No;
public long? FieldNo;
public string Caption;
public bool IsLocalField;
}
}
And when I launch website I have the following error:
'Devart.Data.Linq.Engine.ObjectReader`1[TN.Core.MainModule+MyCriterion]' cannot be converted to type 'System.Collections.Generic.IEnumerator`1[Core_Pages_FlatHandbookFilter+MyCriterion]'."
Note when I add the class "Criterion" to the class "TN.Core.MainModule" and use the class "Criterion" instead of the class "MyCriterion" in the mentioned linq query, the error is disappeared.
I'd like to say that I elimated all namepsaces System.Data.Linq.Mapping and System.Data.Linq from my WebSite. At last, I represent the class "TN.Core.MainModule"
Code: Select all
namespace TN.Core
{
public class MainModule : IHttpModule
{
public void Dispose()
{
// .....
}
public void Init(HttpApplication context)
{
// ....
}
public class Criterion
{
public long No;
public long? FieldNo;
public string Caption;
public bool IsLocalField;
}
}
}