/// <summary> /// New interface factory with specific serializer and exception settings /// </summary> /// <param name="settings"></param> /// <param name="trapExceptions"></param> public JsonInterfaceFactory( JsonSerializerSettings settings, bool trapExceptions = false) { var interfaceSettings = new JsonInterfaceSettings { JsonSerializerSettings = settings, TrapExceptions = trapExceptions }; Initialize(interfaceSettings); }
public JsonInterfacePropertyInterceptor(JsonInterfaceSettings settings) { if (IsFaulted) { throw new Exception($"Fault creating facade object. \n{string.Join("\n", FaultMessages)}"); } var contractResolver = settings.JsonSerializerSettings.ContractResolver ?? new DefaultContractResolver(); var contract = (JsonObjectContract)contractResolver.ResolveContract(typeof(T)); ObjectPropertyNameToJsonPropertyName = contract.Properties.ToDictionary(v => v.UnderlyingName, v => v.PropertyName); }
private void Initialize(JsonInterfaceSettings jsonInterfaceSettings) { Settings = jsonInterfaceSettings; }
/// <summary> /// New interface factory with settings /// </summary> /// <param name="jsonInterfaceSettings"></param> public JsonInterfaceFactory(JsonInterfaceSettings jsonInterfaceSettings) =>