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

List<int?> restores 0 as values #35

Closed
nikolaygekht opened this issue Feb 12, 2021 · 2 comments
Closed

List<int?> restores 0 as values #35

nikolaygekht opened this issue Feb 12, 2021 · 2 comments

Comments

@nikolaygekht
Copy link

After fixing #34 :-)

Now the same sample

List<int?> l = new List<int?>() { 1, null, 2 };
using (var ms1 = new MemoryStream())
{
    BinaronConvert.Serialize(l, ms1);
    using (var ms2 = new MemoryStream(ms1.ToArray()))
    {
          var l1 = BinaronConvert.Deserialize<List<int?>>(ms2);
    }
}

returns

    l1 = {0, null, 0};
@nikolaygekht
Copy link
Author

nikolaygekht commented Feb 12, 2021

Even easier

                using (var ms1 = new MemoryStream())
                {
                    BinaronConvert.Serialize<int?>(1, ms1);
                    using (var ms2 = new MemoryStream(ms1.ToArray()))
                    { 
                        
                        var cr2 = BinaronConvert.Deserialize<int?>(ms2);
                        //cr2 == 0
                        ;
                    }
                }

nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
…ugh for var x = new T() { e1, e2, e3 } syntax.

- add debug code

- refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
* - add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- add debug code

* - refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)

Co-authored-by: Nikolay Gekht <nikolay.gekht@gehtsoftusa.com>
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
- add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
- add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
- add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 12, 2021
* - add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- add debug code

* - refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)

Co-authored-by: Nikolay Gekht <nikolay.gekht@gehtsoftusa.com>
zachsawcs added a commit that referenced this issue Feb 16, 2021
* - add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- add debug code

* - refactor the method of restoring IEnumerable with Add method (#31)
- support of nullable in collections and as properties (#34, #35, #36)

Co-authored-by: Nikolay Gekht <nikolay.gekht@gehtsoftusa.com>
nikolaygekht added a commit to nikolaygekht/Binaron.Serializer that referenced this issue Feb 17, 2021
* Fix nullables and add support for IEnumerable with Add method

* - add support of IEnumerable with Add method (i.e. implementation enough for var x = new T() { e1, e2, e3 } syntax.
- add debug code

* - refactor the method of restoring IEnumerable with Add method (zachsaw#31)
- support of nullable in collections and as properties (zachsaw#34, zachsaw#35, zachsaw#36)

Co-authored-by: Nikolay Gekht <nikolay.gekht@gehtsoftusa.com>

* v4.1.0

Co-authored-by: Zach Saw <zach.saw@carsales.com.au>
Co-authored-by: Nikolay Gekht <nikolay.gekht@gehtsoftusa.com>
Co-authored-by: Zach Saw <zach.saw@gmail.com>
@nikolaygekht
Copy link
Author

I confirm that it is fixed in the current master

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

No branches or pull requests

1 participant