Skip to content
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

ToDictionary-extension-method fails on dates and arrays #38

Closed
mattiasnordqvist opened this issue Jun 9, 2015 · 5 comments
Closed

ToDictionary-extension-method fails on dates and arrays #38

mattiasnordqvist opened this issue Jun 9, 2015 · 5 comments

Comments

@mattiasnordqvist
Copy link
Owner

[Test]
public void TestDate()
{
    var now = DateTime.UtcNow;
    var d = new { Timestamp = now }.ToDictionary();
    Assert.AreEqual(now, d["Timestamp"]);
}
@carl-berg
Copy link
Collaborator

Same behavior from arrays...

var packagedArray = new { MyArray = new int[0] }.ToDictionary();

@mattiasnordqvist
Copy link
Owner Author

Generally, ToDictionary() will fail on all objekts that have circular references.

@carl-berg carl-berg changed the title ToDictionary-extension-method fails on dates ToDictionary-extension-method fails on dates and arrays Jun 15, 2015
@mattiasnordqvist
Copy link
Owner Author

We should write some tests like this:

[Test]
public void TestToDictionary_xxx()
{
    var now = DateTime.UtcNow;
    var d = CreateJson(new { Timestamp = now }.ToDictionary());
    var d2 = CreateJson(new { Timestamp = now });
    Assert.AreEqual(d, d2);
}

@mattiasnordqvist
Copy link
Owner Author

Since this feature is no longer enabled by default, I will remove it from the release 1.0.0.0 milestone

@mattiasnordqvist mattiasnordqvist removed this from the Release 1.0.0.0 milestone Jul 14, 2015
@mattiasnordqvist
Copy link
Owner Author

ToDictionary has been removed as of v5.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants