C
C#11mo ago
BekirK

On the ValueGeneratedNever() method

Hi guys, I want to ask you a question about the ValueGeneratedNever() method. I couldn't find what I was looking for on the internet. I know what the ValueGeneratedNever() method does. However, I don't know in which scenario I will use it. I'm reviewing a project. As you can see in the image, the Id value is generated as Guid in AggregateRoot. And ValueGeneratedNever() is used in TypeConfiguration. Okay, this is how we tell to the db don't create an Id value for us I'll handle in codebase, but what I don't understand is that we send it by giving a value anyway. So, even if we do not use ValueGeneratedNever(), it will add the value we generated since we gave the Id value in the code base. Additionally, ValueGeneratedNever() has not been used elsewhere and has only been used for a few entities. Can someone explain this, why do we really need to ValueGeneratedNever()?
No description
1 Reply
BekirK
BekirKOP11mo ago
No description
Want results from more Discord servers?
Add your server