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

Exclude fields in deserialization model #20

Open
Severus1992 opened this issue Mar 26, 2020 · 0 comments
Open

Exclude fields in deserialization model #20

Severus1992 opened this issue Mar 26, 2020 · 0 comments

Comments

@Severus1992
Copy link

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();
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