Skip to main content

All Questions

0 votes
1 answer
49 views

dotNET minimal API getting 404 not found on a secure endpoint

I am trying to implement a rest api using the dotNET framework. I am experiencing a problem with the "/secure" endpoint, getting 404 as a response message whether I login or not. If I don't ...
Samuele Calugi's user avatar
-1 votes
1 answer
65 views

Cannot add multiple same objects to DB, only distinct are saved. .NET EntityFramework

I have a template of exercise with name, description and amount of sets. I want to create multiple objects of Exercise * amount of sets. For example I have template [{ "name" : "Legs&...
Zetka's user avatar
  • 13
0 votes
1 answer
49 views

How to plan migration from EF 6 with EDMX to EF Core

We have a pretty complex .EDMX in EF 6.0 which was designed using database-first approach (against SQL Server) back in 2014. It uses lot of features of EF like TPT, TPC, TPH, entity splitting, custom ...
Shantanu Gupta's user avatar
0 votes
1 answer
26 views

.NET Core migration suddenly stopped working: error MSB1008

I have a simple project with a couple of migrations that ran successfully before already. I have opened the project today and I can't add any new migrations where I get the error: "MSB1008: Only ...
David Borštner's user avatar
0 votes
2 answers
73 views

BulkMerge with child entity gives FK constraint

I'm using Entity Framework Extensions but can't get the simplest BulkMerge to work. Basically I have a DbContext with Stock. Each Stock has a IList<StockPrice>. Whenever a the stock price is ...
smoksnes's user avatar
  • 10.8k
4 votes
1 answer
88 views

Clean architecture: inverting dependency of EF DbContext

I stumbled upon this article that explains the principles of clean architecture. I want to apply those principles in ASP.NET Core + EF. I got stuck at this part: The Application layer only depends on ...
karlosss's user avatar
  • 3,085
1 vote
1 answer
44 views

How to check if row (record) exists that was created during current month in EF Core

I would like to know if there is any more efficient way to check if I have a record that was created during the current month (June 2024)? Currently I use multiple conditions, but don't know if there ...
chuckd's user avatar
  • 14.1k
0 votes
1 answer
87 views

What is the maximum supported compatibility level for EF6?

I'm in the process of migrating old .NET Framework & EF 6 Web API to .NET 8 and EF Core 8. Yesterday because of this breaking change, I changed compatibility_level to 130 for our Azure SQL ...
Saibamen's user avatar
  • 638
0 votes
0 answers
53 views

EF Core Adding Unwanted Default Value to String Property

I'm encountering an issue with Entity Framework Core (using Pomelo for MySQL) in my .NET Core 6 application. When I update or recreate the database, a specific field (OperationCode) in my XXX table is ...
ZihamZuhair's user avatar
0 votes
0 answers
34 views

Entity Framework Core not recognising mapped user-defined function

I'm using Entity Framework Core with .NET 8 and trying to call a user-defined function from C# code. I'm following the instructions here but have a slightly different use case. Rather than having the ...
amarsha4's user avatar
  • 483
0 votes
1 answer
69 views

How to always get updated data from the database?

I have an NET Core API 2.1 and I need to select data from database for my report page. The data is updating by other applications and I need to read always updated data from db. But I couldn't force ...
alinz's user avatar
  • 81
0 votes
0 answers
48 views

EF Core - Custom property in query

I have an entity represeting exercise training set: public partial class TrainingSetEntity { public int? RepCount { get; set; } public double? WeightLiftedKilograms { get; set; } } and I want ...
Kebechet's user avatar
  • 2,061
2 votes
0 answers
80 views

Entity Framework Core 8 Where IN vs Where IN OPENJSON Additional Question

I have reviewed the other post on this, and found my scenario to be much more un workable, to the extent that I am unsure if it is the way I am writing the query that is the issue. Surely it must be ...
Alex Holmes's user avatar
0 votes
0 answers
35 views

Entity Framework Core's BulkInsert doesn't care about nvarchar column length

I'm trying to insert some records with DbContext.BulkInsert, and I have a column that's nvarchar(50), but as soon as I try adding a record where this column is populated with 21 characters it breaks, ...
Monset's user avatar
  • 647
1 vote
1 answer
65 views

Entity Framework Core - Nullable foreign key with empty referrence object after using .Include method

It is weird that the reference object is null even when corresponding refernce record actually exists. Here are the details. // Model public class ItemSoldPrice { public int Id { get; set; } ...
Robin Sun's user avatar
  • 1,516

15 30 50 per page
1
2 3 4 5
320