title: RestSharp deserialization of Enum Type Property
body: <p>I have an object</p>
  
  <pre><code>            var testTcc = new TrendingConfigurationConfigDto
              {
                  TrendingConfigurationId =1,
                  ConfigId = 1,
                  DeviceId = 1,
                  Selected = true,
                  YAxisPosition = YAxisPosition.Left,
                  Order = 1,
                  Color = "#ffffff",
                  Configuration = new BO.Shared.Dtos.List.ConfigurationListDto
                  {
                      Id = 1,
                      Name = "configuration",
                      Alias = "configuationAlias",
                      EnableEdit = true,
                      IsBusinessItem = true
                  },
                  Device = new BO.Shared.Dtos.List.DeviceListDto
                  {
                      Id = 1,
                      Name = "Device"
                  }
              };
  </code></pre>
  
  <p>when I serialized it into json as </p>
  
  <pre><code>var jsonTcc = SimpleJson.SerializeObject(testTcc);
  </code></pre>
  
  <p>it returned string containing json object with YAxisPosition = 1, and when I tried deserializing it using </p>
  
  <pre><code>testTcc = SimpleJson.DeserializeObject&lt;TrendingConfigurationConfigDto&gt;(jsonTcc);
  </code></pre>
  
  <p>It is giving an exception System.InvalidCastException with message 'Specified cast is not valid'.</p>
  
  <p>I tried changing YAxisPosition value in json string to string "1" or "Left" it was always giving me the same error, until I removed the property YAxisPosition from json string.</p>
  
  <p>I might be missing some thing (an Attribute on enum property or something similar).</p>
  
  <p>Please help me finding a way so that I can Serialize and De-serialize an object which contains Enum type property, using RestSharp.</p>
  
  <p>Note: I tried successful serialization and de-serialization using NewtonSoft. but I do not want a dependency of my Web API Client on NetwonSoft, as I am already using RestSharp.</p>