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
[BUG] TableEntity.GetDateTime throws InvalidOperationException #25323
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hi @j055 ex. var t = new TableEntity();
t.Add("DateTime", DateTime.UtcNow);
t.Add("DateTimeOffset", DateTimeOffset.UtcNow);
Console.WriteLine(t.GetDateTime("DateTime")); // prints 11/15/2021 4:29:22 PM
Console.WriteLine(t.GetDateTimeOffset("DateTime")); // throws
Console.WriteLine(t.GetDateTimeOffset("DateTimeOffset")); // prints 11/15/2021 4:29:22 PM +00:00
Console.WriteLine(t.GetDateTime("DateTimeOffset")); // throws |
Hi @j055. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Hi @j055, since you haven’t asked that we “ |
I've updated To Reproduce above. You need a storage account to reproduce. Then update and retrieve when the entity contains a |
/unresolve |
Thanks for the additional information. I see the problem and will be working on a fix. |
Describe the bug
TableEntity.GetDateTime
throwsInvalidOperationException
. Cannot return System.Nullable`1[System.DateTime] type for a System.DateTimeOffset typed property.The date was added using
TableEntity.Add
, e.g.Expected behavior
TableEntity.GetDateTime
should return a validNullable<DateTime>
without error.Actual behavior (include Exception or Stack Trace)
To Reproduce
TableClient.UpsertEntityAsync
with aTableEntity
containing aSystem.DateTime
propertyTableClient.GetEntityAsync<TableEntity>
to retrieve entity andTableEntity.GetDateTime
to parse date.Exception is thrown.
As above
Environment:
The text was updated successfully, but these errors were encountered: