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

how to serialize data row rule #25

Open
deep1234ea opened this issue Aug 6, 2020 · 2 comments
Open

how to serialize data row rule #25

deep1234ea opened this issue Aug 6, 2020 · 2 comments

Comments

@deep1234ea
Copy link

DataRule.Create("Column2", mreOperator.Equal, "123") & DataRule.Create("Column1", mreOperator.Equal, "Test");

I used this example and want to serialize this rule . Getting error.

@jamescurran
Copy link
Contributor

I'll have a Pull Request for this soon, but to get you working now:

In MRE.cs, add the serializarion attributes to DataRule:

    [DataContract]
    public class DataRule : Rule
    {
        [DataMember]
        public string Type { get; set; }

Include the "known type" in the serializer:

	        var serializer = new DataContractJsonSerializer(typeof(DataRule), new[] { typeof(Rule) });

Also, if Column2 is an int, make it that in the rule:

	        Rule rule = DataRule.Create("Column2", mreOperator.Equal, 123) 
                          & DataRule.Create("Column1", mreOperator.Equal, "Test");

@deep1234ea
Copy link
Author

deep1234ea commented Aug 7, 2020 via email

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

2 participants