Skip to content

Commit

Permalink
Updating CSharp Dependency to fix issue sendgrid#256
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious authored and Maxim Dubrovkin committed Sep 20, 2016
1 parent e00b2e7 commit f08c798
Show file tree
Hide file tree
Showing 11 changed files with 530 additions and 380 deletions.
20 changes: 11 additions & 9 deletions SendGrid/Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Web.Script.Serialization;
using SendGrid.Helpers.Mail;
using Newtonsoft.Json;

namespace Example
{
Expand Down Expand Up @@ -32,9 +33,8 @@ private static void HelloEmail()
mail.Personalization[0].AddTo(email);

String ret = mail.Get();

string requestBody = ret;
dynamic response = sg.client.mail.send.post(requestBody: requestBody);
Object requestBody = JsonConvert.DeserializeObject<Object>(ret);
dynamic response = sg.client.mail.send.post(requestBody: requestBody.ToString());
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());
Expand Down Expand Up @@ -232,9 +232,8 @@ private static void KitchenSink()
mail.ReplyTo = email;

String ret = mail.Get();

string requestBody = ret;
dynamic response = sg.client.mail.send.post(requestBody: requestBody);
Object requestBody = JsonConvert.DeserializeObject<Object>(ret);
dynamic response = sg.client.mail.send.post(requestBody: requestBody.ToString());
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());
Expand Down Expand Up @@ -268,7 +267,8 @@ private static void ApiKeys()
'alerts.read'
]
}";
response = sg.client.api_keys.post(requestBody: requestBody);
Object json = JsonConvert.DeserializeObject<Object>(requestBody);
response = sg.client.api_keys.post(requestBody: json.ToString());
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());
Expand All @@ -292,7 +292,8 @@ private static void ApiKeys()
requestBody = @"{
'name': 'A New Hope'
}";
response = sg.client.api_keys._(api_key_id).patch(requestBody: requestBody);
json = JsonConvert.DeserializeObject<Object>(requestBody);
response = sg.client.api_keys._(api_key_id).patch(requestBody: json.ToString());
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());
Expand All @@ -308,7 +309,8 @@ private static void ApiKeys()
' user.profile.update'
]
}";
response = sg.client.api_keys._(api_key_id).put(requestBody: requestBody);
json = JsonConvert.DeserializeObject<Object>(requestBody);
response = sg.client.api_keys._(api_key_id).put(requestBody: json.ToString());
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());
Expand Down
12 changes: 2 additions & 10 deletions SendGrid/Example/Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SendGrid.CSharp.HTTP.Client, Version=2.0.4.0, Culture=neutral, PublicKeyToken=79219bf4e5ecaaca, processorArchitecture=MSIL">
<HintPath>..\packages\SendGrid.CSharp.HTTP.Client.2.0.4\lib\SendGrid.CSharp.HTTP.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SendGrid.SmtpApi, Version=1.3.1.0, Culture=neutral, PublicKeyToken=2ae73662c35d80e4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGrid.SmtpApi.1.3.1\lib\net40\SendGrid.SmtpApi.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net" />
Expand Down
2 changes: 1 addition & 1 deletion SendGrid/Example/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
3 changes: 1 addition & 2 deletions SendGrid/Example/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="SendGrid.CSharp.HTTP.Client" version="2.0.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
</packages>
2 changes: 1 addition & 1 deletion SendGrid/SendGrid/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
20 changes: 10 additions & 10 deletions SendGrid/SendGrid/SendGrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
<AssemblyOriginatorKeyFile>sendgrid-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SendGrid.CSharp.HTTP.Client, Version=2.0.4.0, Culture=neutral, PublicKeyToken=79219bf4e5ecaaca, processorArchitecture=MSIL">
<HintPath>..\packages\SendGrid.CSharp.HTTP.Client.2.0.4\lib\SendGrid.CSharp.HTTP.Client.dll</HintPath>
<Reference Include="SendGrid.CSharp.HTTP.Client, Version=2.0.6.0, Culture=neutral, PublicKeyToken=79219bf4e5ecaaca, processorArchitecture=MSIL">
<HintPath>..\packages\SendGrid.CSharp.HTTP.Client.2.0.6\lib\SendGrid.CSharp.HTTP.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -94,11 +94,11 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
4 changes: 2 additions & 2 deletions SendGrid/SendGrid/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="SendGrid.CSharp.HTTP.Client" version="2.0.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="SendGrid.CSharp.HTTP.Client" version="2.0.6" targetFramework="net452" />
</packages>
Loading

0 comments on commit f08c798

Please sign in to comment.