{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4189","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4189/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4189/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4189/events","html_url":"https://github.com/aspnet/EntityFramework/issues/4189","id":124215803,"number":4189,"title":"Value generated on add (or update)","user":{"login":"Asesjix","id":7798041,"avatar_url":"https://avatars.githubusercontent.com/u/7798041?v=3","gravatar_id":"","url":"https://api.github.com/users/Asesjix","html_url":"https://github.com/Asesjix","followers_url":"https://api.github.com/users/Asesjix/followers","following_url":"https://api.github.com/users/Asesjix/following{/other_user}","gists_url":"https://api.github.com/users/Asesjix/gists{/gist_id}","starred_url":"https://api.github.com/users/Asesjix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Asesjix/subscriptions","organizations_url":"https://api.github.com/users/Asesjix/orgs","repos_url":"https://api.github.com/users/Asesjix/repos","events_url":"https://api.github.com/users/Asesjix/events{/privacy}","received_events_url":"https://api.github.com/users/Asesjix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-29T14:07:13Z","updated_at":"2015-12-30T17:56:48Z","closed_at":"2015-12-30T09:49:55Z","body":"I have a problem with the function \"ValueGeneratedOnAdd\" and \"ValueGeneratedAddOrUpdate\".\r\nNow I have repeatedly read through the documentation [Generated Properties](https://ef.readthedocs.org/en/latest/modeling/generated-properties.html#value-generated-on-add).\r\n I just do not get out of the type DateTime or DateTimeOffset trigger a generation.\r\n\r\nBoth Fluent Api methods not working:\r\n\r\n```\r\nb.Property(p => p.Created).ValueGeneratedOnAdd();\r\n\r\nb.Property(p => p.Created).ValueGeneratedOnAdd().HasDefaultValueSql(\"SYSDATETIMEOFFSET()\");\r\n```\r\nWhat am I doing wrong? or is it a bug?"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/168045572","html_url":"https://github.com/aspnet/EntityFramework/issues/4189#issuecomment-168045572","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4189","id":168045572,"user":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T17:56:47Z","updated_at":"2015-12-30T17:56:47Z","body":"@Asesjix as @ErikEJ mentioned, just saying that the value is generated on add/update is not enough... you need to also say how to generate the date values (EF doesn't know that you want the current date set on each update). The way default values work in SQL Server is that they are used when you initially insert data, but they don't get re-calculated each time you update the data... for that you need a trigger or something similar."}}