class Test { [StateAtt(StateCompareOption.AnyButNotThis)] // , public double somefiled; public double anothersomefiled; // - [StateAtt(StateCompareOption.ExactlyLikeThis)] // public string StringProp { get; set; } public int IntProp { get; set; } // - public Test(string StringProp, int IntProp, double somefiled, double anothersomefield) { this.StringProp = StringProp; this.IntProp = IntProp; this.somefiled = somefiled; this.anothersomefiled = anothersomefield; } }
Test a1 = new Test("text", 1, 50.4251, 34); State<Test> state = State<Test>.CreateState(a1); Test a2 = new Test("text", 1, 50.4252, 34); state.IsInTheSameState(a2).ToString().ToConsole(); // true
Source: https://habr.com/ru/post/270099/
All Articles