Skip to content

Exclude fields in deserialization model #20

@Severus1992

Description

@Severus1992

Hello! Interested in the following question: is it possible to add the ability to exclude fields in the deserialization model? For example:
public class InputClass
{
public int Value1 { get; set; }
public Guid Value2 { get; set; }
public string Value3 { get; set; }
public decimal Value4 { get; set; }
public List Container { get; set; }

public class Container1
{
public long Name1 { get; set; }
public DateTime Name2 { get; set; }
public string Name3 { get; set; }
}
}

public class OutputClass
{
public Guid Value2 { get; set; }
public string Value3 { get; set; }
public decimal Value4 { get; set; }

public class Container2
{
public DateTime Name2 { get; set; }
public string Name3 { get; set; }
}
}

var testData = new InputClass { ...... };
var bytes= BinaryConverter.Serialize(testData);
var result = BinaryConverter.Deserialize(bytes);
Now, an exception occurs when deserializing.

  1. Is there a plan to add the following deserialization method?
    public static T Deserialize(Type type, byte[] array) where T : new();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions