Git Product home page Git Product logo

Comments (5)

hhblaze avatar hhblaze commented on June 8, 2024

Please supply more or less runnable code.

Such constellation works:

public partial class BC_T1
  {
      public bool Head { get; set; }
  }

  public partial class BC_T2: BC_T1
  {
      public bool Hand { get; set; }
  }

public partial class BC_T3 
{
public List<BC_T2> bcccs { get; set; }
}

----------------------------------   now generate for each class with BiserObjectify encoders and use it like

            //      BiserObjectify.Generator.Run(typeof(BC_T3), true,
            //@"------\VSProjects\tests", forBiserBinary: true, forBiserJson: false, null);

            //      BiserObjectify.Generator.Run(typeof(BC_T1), true,
            //@"---\VSProjects\tests", forBiserBinary: true, forBiserJson: false, null);

            BC_T3 mn1 = new BC_T3 { bcccs = new List<BC_T2>() };

            mn1.bcccs.Add(new BC_T2 { Hand = true, Head = true });            

            var serializedObjectAsByteArray = mn1.BiserEncoder().Encode();
            var retoredBinaryObject = BC_T2.BiserDecode(serializedObjectAsByteArray);

from biser.

robotron2084 avatar robotron2084 commented on June 8, 2024

In your example change your list to be of type List<BC_T1> and it will deserialize your BC_T2 as a BC_T1.

from biser.

hhblaze avatar hhblaze commented on June 8, 2024

Better if you create for me a sample project

image

from biser.

hhblaze avatar hhblaze commented on June 8, 2024

But, there is a non-desired behavior in deserializing, will check if it is possible to fix somehow:

image

image

from biser.

hhblaze avatar hhblaze commented on June 8, 2024

And this is hard to fix, because it will use decoder of BC_TC2 (that is richer) to deserialize BC_TC1.
Must be used like this

image

from biser.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.