✅ In Identity Model class i am having CS1729 coded error message.
Hi, I am trying to build a simple library management system using asp.net but Identity Model is giving me CS1729 error, I googled but couldn't find a solution to it. I have added my "Books" class and "Identity Models" to attachments, could you please give me a tip about how can I solve this error. ( I tried to write it as "public ApplicationDbContext() : base("DefaultConnection", false)" and "public ApplicationDbContext() : base("DefaultConnection")" but in that case gave me other errors as well.) Thank you.
![No description](https://cdn.answeroverflow.com/1259994922619244544/1.png)
![No description](https://cdn.answeroverflow.com/1259994923000664187/2.png)
![No description](https://cdn.answeroverflow.com/1259994923265167471/3.png)
10 Replies
I mean, the error is quite clear here
DbContext
constructor does not take two arguments
What would this throwIfv1Schema
do, if it existed?Takes connection string
After deleting it it says this whenever I try to add MVC controler with views using entity framework
![No description](https://cdn.answeroverflow.com/1260022180323000400/4.png)
And I cannot add my model and DBContext Classes to controllers
![No description](https://cdn.answeroverflow.com/1260022473274167306/image.png)
You need to either register the DbContext as a service or override OnConfiguring.
Take a look at the documentation here:
https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=visual-studio
or
Getting Started - EF Core
Getting started tutorial for Entity Framework Core
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
@TeBeCo thank you so much
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered
Documentation helped tbh