Database operation expected to affect 1 row(s) but actually affected 0 row(s) In EF Core, there is a rule that is not obvious about setting the primary key on child entities and adding it to the parent when the parent entity has already been saved (or retrieved from the context).
When creating a parent entity that is not saved, when you add a child entity where you are manually setting the primary key, you will not see this behavior.
Choosing between numeric types in C# Choosing between double, decimal, and float in C# depends on the specific requirements of your application. Each of these types has its own characteristics, and the choice should be made based on factors such as precision, range of values, memory usage, and performance.
double:
Use double when you need a wide range of representable values and can tolerate some loss of precision. Suitable for general-purpose mathematical calculations where high precision is not critical.