This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
//Example Usage | |
/* | |
var otherTypeObj = new SomeOneElsesType(); | |
var settings = new JsonSerializerSettings() | |
{ | |
ReferenceLoopHandling = ReferenceLoopHandling.Ignore, | |
ContractResolver = new WhiteListPropertyResolver("Name","Number","Display","Required","MaxLen","MinLen","Type") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void Should_be_able_to_wrap_interface_with_one_method() | |
{ | |
Func<string, int> length = s => s.Length; | |
var wrapped = DelegateWrapper.WrapAs<IAnsweringEngine>( length ); | |
Assert.NotNull( wrapped ); | |
var i = wrapped.GetAnswer( "Answer to Life the Universe and Everything" ); | |
Assert.Equal( 42, i ); | |
} | |
//from http://kozmic.pl/2009/03/20/castle-dynamic-proxy-tutorial-part-viii-interface-proxy-without-target |
NewerOlder