-
-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.NotSupportedException : Unsupported expression: c => c.Prices. Non-overridable members (here: TekaSelectContext.get_Prices) may not be used in setup / verification expressions. #961
Comments
Try making |
@stakx Thank you so much, You really saved my day. |
@stakx thank you so much this error takes my two days |
how to make virtual |
Just you need to declare virtual in your entity class. Like public virtual Department? department { get; set; } Department is my entity table name. |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; namespace MyDemo.Database.DataContext
} For your test controller : using AutoMapper; namespace MyDemo.TestCases.Service.Hospital
} @Mohammed-Hakeeb-Javid this way working for me. what is Persistent here you have inherited? Try this kind of code and let me know if it will not work will find a way for you. |
Hi @BhavinVoingTech Thanks for replay here problem is our new project pattern they are using in context class like this
instead of
so how to pass there iconfigure and iauth with connection string? tried various method not working! |
also was writing for repository test so when we were passig moq.object to repo giving this error |
Hi everyone,
I have a problem with testing my Context.
My app is running in .NET Core 2.2 and I've installed EFCore v2.2.6.
When I launch my test I get this error:
System.NotSupportedException : Unsupported expression: c => c.Prices
Non-overridable members (here: MyContext.get_Prices) may not be used in setup / verification expressions.
This is my context class:
This is My repository:
and this is my test:
Can anyone help me?
Thanks :)
The text was updated successfully, but these errors were encountered: