How to get around “Internal .NET Framework Data Provider error 1025.”?

后端 未结 3 1093
轮回少年
轮回少年 2021-01-06 01:11

I am using the Entity Framework 4.3, POCO, database first and I am getting the following error:

Internal .NET Framework Data Provider error 1025.

3条回答
  •  再見小時候
    2021-01-06 01:13

    The reason why this happens is subtle.

    Queryable.All need to be called with an Expression. Passing in just the method 'reference' creates a delegate, and subsequently, Enumerable.All becomes the candidate instead of the intended Queryable.All.

    This is why your solution you posted as an answer works correctly.

    EDIT

    so if you write the statement as this, it will work without exception:

    var res = ctx.As.Where(
      a => a.Bs.Select(b => b.SomeName).All(b => names.Contains(b)));
    

提交回复
热议问题