EF Non-static method requires a target

后端 未结 2 1167
孤城傲影
孤城傲影 2020-12-06 10:52

I\'ve serious problems with the following query.

context.CharacteristicMeasures
        .FirstOrDefault(cm => cm.Charge == null &&
                        


        
2条回答
  •  情话喂你
    2020-12-06 10:53

    Try moving newAreaItem == null outside of the query

    bool newAreaItemIsNull = (newAreaItem == null);
    

    and replace newAreaItem == null with newAreaItemIsNull in query.

    Query parser can only operate with the objects in the database, and newAreaItem is not one of them.

提交回复
热议问题