I'm building an ASP.NET Web Api with simple CRUD operations and a Database which should be generated using EF Code First and Migrations. In terms of t ...
I'm building an ASP.NET Web Api with simple CRUD operations and a Database which should be generated using EF Code First and Migrations. In terms of t ...
I have a question. Is it possible to read the appsettings.json File in the DbContext class of another class library? I tried to write an AppSettingsSe ...
I have below customer and customer message model. I want to get top n customers with latest messages and have only the latest message per customer inc ...
I am working on an ASP.NET Core project using code first I want to alter database design. I have a case were I need to add two foreign keys to the sam ...
I have a Movie model and a Genre class as follows: When trying to use Update-Database after creating the migration shown here: I get this error: ...
I am having class library project in .NET 6 where I am using EF Core. I am able to create tables using code first approach but stuck on how to create ...
Running on my dev machine, connected to the db on another machine with this connection string in Visual Studio: I'm connected, life is good. Trying ...
I have 4 entities in my project: Project, Task, Comment, AttachedFile In first 3 entities the user can attach files to them i think it's one to many ...
Below is my override saveChanges Methed which calls SetChanges Method Right now, Sometimes code works completely fine but in some scenario It gives ...
I want the use a general Picture model with an enum type - like this: And I use this enum in general picture model like this: But this is the ri ...
I created my database with entity framework - code first. I have a working registration page but know I added QR part which is integer. I do not wa ...
I'm trying a code first approach to creating multiple logging tables for a data archiver. The data that is being archived conforms to one model, but t ...
I'm trying to display foreign key properties values using class that should have access to it: So for Specialist it works just fine: But for t ...
I am working on a project which involves EF Core. I would like to use the foreign keys from Category with one single navigation property. Therefore, ...
I have an ApplicationUser, that has a collection of UserAddress. I simply want to expose endpoints to perform CRUD on these addresses. However when I ...
I've configured one to many relation between entity User and Role in my DbContext. When I'm creating user through POST I'm getting this response whic ...
I have a table called Quotations and it has an unique string field called QuotationNo. So I have implemented it by calling _db.SaveChanges() method ...
I'm working in asp.net.core Entityframework 6, CodeFirst Approach. I believe i'm seeding the data in a wrong order, or in the wrong way. I use a simil ...
I am now working on a project for university where I am trying to extract some data from a database and then send it through rest controllers. The pr ...
The entire error: The foreign key property 'Appointment.CustomerId1' was created in a shadow state because a conflicting property with the simple ...