You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by GlenYappa June 2, 2023
I am in the process of upgrading a large business object library from Csla 4 to Csla 6.2.2 while at the same time moving from .Net Framework 4.7.2 to .Net Standard 2.0. One issue that I am having is DateTime properties are losing the DateTime.Kind when deserialized. In the example below I have a simple ReadOnly csla object with a nullable Datetime and I am serializing/deserializing with the MobileFormatter directly just for test purposes. You can see that after deserialization the Kind value is Unspecified. Is this a known issue?
var t = TestHarness.App.DataPortalFactory.GetPortal<TestHarness.DateTimeTest>().Create();
t.ID = Guid.NewGuid();
t.TestDate = DateTime.Now;
Console.WriteLine(t);
var formatter = new Csla.Serialization.Mobile.MobileFormatter(TestHarness.App.AppContext);
byte[] bytes = new byte[0];
using (MemoryStream stream = new MemoryStream())
{
formatter.Serialize(stream, t);
bytes = stream.ToArray();
}
using (MemoryStream stream = new MemoryStream(bytes))
{
t = (TestHarness.DateTimeTest)formatter.Deserialize(stream);
}
Console.WriteLine(t);
ID = ba5ddc50-75ea-4b7d-b656-7fc12faab73e
TestDate = 6/2/2023 8:59:27 AM
DateTime Kind = Local
ID = ba5ddc50-75ea-4b7d-b656-7fc12faab73e
TestDate = 6/2/2023 8:59:27 AM
DateTime Kind = Unspecified
Thanks
The text was updated successfully, but these errors were encountered:
Discussed in #3362
Originally posted by GlenYappa June 2, 2023
I am in the process of upgrading a large business object library from Csla 4 to Csla 6.2.2 while at the same time moving from .Net Framework 4.7.2 to .Net Standard 2.0. One issue that I am having is DateTime properties are losing the DateTime.Kind when deserialized. In the example below I have a simple ReadOnly csla object with a nullable Datetime and I am serializing/deserializing with the MobileFormatter directly just for test purposes. You can see that after deserialization the Kind value is Unspecified. Is this a known issue?
ID = ba5ddc50-75ea-4b7d-b656-7fc12faab73e
TestDate = 6/2/2023 8:59:27 AM
DateTime Kind = Local
ID = ba5ddc50-75ea-4b7d-b656-7fc12faab73e
TestDate = 6/2/2023 8:59:27 AM
DateTime Kind = Unspecified
Thanks
The text was updated successfully, but these errors were encountered: