Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

unable to create a constant value of type

$
0
0

In the first, my project is OK.

A few days ago, I add some entity to database (use Entity Framework 6.0, Code First), everystep is OK.

And then, it occurred this problem.

The Example Code is:

class A
{
    public int Id{get;set;}
}

class B
{
    public int Id{get;set;}
    public int Aid{get;set;}
    public virtual A A{get;set;}
}

//下面的Linq就报告错误:

Bs.Where(x=>x.A==a).FirstOrDefault();

Thanks!


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>