New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DatabaseGeneratedOption.Computed always causes null #62
Comments
I'm facing the same situation at the moment. I'm going to download the source code and try to find if it's possible to implement the solution you are suggesting. |
Thats the spirit! |
I took a look on the code and I did find some references to computed columns. However I couldn't catch the moment that the computed column is set to null. Maybe some contributors can give us some feedback? @JonathanMagnan |
Hello @pfaustinopt , Yes, we will be happy to look at it at the same time of your other problem. Do you think you could provide us a test project with this issue? It will make easier/faster for my developer to getting started for investigating it. We now always ask for a project since we found out that most issues are missing some essential information or are resolved by the requestor when creating it (Even if the issue seem very easy to reproduce, by getting a test project, it allow us to give a faster support and better experience for the support of all our free libraries) Best Regards, Jonathan |
Here you have it. |
Great thank ;) |
Hello @pfaustinopt , After some time passed on this issue, unfortunately, I don't think we can do anything for this moment. There is currently no trigger logic implemented on Best Regards, Jonathan |
Hello, i'm facing the same issue. Maybe you can have a look at it? Best regards |
facing the same issue |
Hello @manojItela , We recently started to work on this project (We want to clean most issues/pull in September), we will very soon look how to handle this scenario since that's very common. Best Regards, Jonathan |
We're facing the same problem since almost a half year. Will this be fixed in future releases? Best regards |
Hello @5p1k3md , We hope that it will eventually be fixed but unfortunately, this one is complex to fix and our time is very limited when supporting free library ;( |
Hello @JonathanMagnan, can you give us a vague assumption if it will be fixed in 1 month or 1 year? Thanks in advance. Best Rregards. |
We will probably not work on it in the next following month, so since we have no date, let say 1 year |
Is there any solution to this problem? I do not need that the value of the computed column to be correct, I just need that I can add values without crashing. Can we exclude the computed column? |
Hello @drameryan , We will look at it. Adding an option to exclude those computed columns could be a perfect workaround. Thank for your suggestion. Best Regards, Jonathan |
Hello @drameryan , Do your computed column value is a key? We tried several column types but we are not able to reproduce the |
Hi @JonathanMagnan , No, it's a DB First model, and the calculated column was simply Fullname, computed as Name + ' ' + Surname. So it doesn't have a default vale. Default Value -> not defined |
Hello @drameryan , It's possible for you to provide a project sample? It will make easier for my developer to get started to fix this error. I highly believe something would be possible in this case. |
I think I isolated the case. It's DB First model. I created 3 test cases, first table with no computed column, Id, Name, Surname The first 2 cases works as expected. But, in the third case, Fullname also automatically becomes NOT NULL, and the default Null value causes the crash NMemory.Exceptions.ConstraintException: Column 'Fullname' cannot be null. Error code: GenericError Here is my project folder, you can find also the sql create table scripts inside. |
Thank a lot for the project @drameryan , Using your project, we easily find a quick fix. We will re-investigate our fix tomorrow to try to improve it. Unless something goes wrong, you can expect a new release next Monday. Best Regards, Jonathan |
That's great! Thank you very much. Regards |
Hello @drameryan , The v2.1.0 has been released. A default value (or empty string) will be inserted when you turn on the following options We are currently investigating for a better fix but meanwhile this one work with the example you provided. Best Regards, Jonathan |
@JonathanMagnan that's great, I checked and confirm that it works as expected! Thank you very much |
I have a column like the following:
and a SQL trigger that sets it as expected. Entity framework expects the database to set this property and reads it back after each insert and update. Effort always reports this as null. That is:
fails where
dbContext
is aDbContext
created from a transcient EffortDbConnection
.I would like some mechanism to get around this. Perhaps an
EntityWithComputedColumnInserting
event and anEntityWithComputedColumnUpdating
event for allowing users to handle the computing of computed columns. Say using anEventArgs
similar to the following:I could then make an event handler like the following in my test class:
The text was updated successfully, but these errors were encountered: