diff options
author | Elmer Thomas <elmer@thinkingserious.com> | 2015-11-06 15:34:29 -0800 |
---|---|---|
committer | Elmer Thomas <elmer@thinkingserious.com> | 2015-11-06 15:34:29 -0800 |
commit | 526eb12ea6a33344ec48b93e7bae3895ecc12e85 (patch) | |
tree | e703a82d6a09815113c5e0780d631b9e48bd9766 | |
parent | 1f0ea577d8bc48805d4618d3d4d2fcb82a27ec61 (diff) | |
download | sendgrid-csharp-526eb12ea6a33344ec48b93e7bae3895ecc12e85.zip sendgrid-csharp-526eb12ea6a33344ec48b93e7bae3895ecc12e85.tar.gz sendgrid-csharp-526eb12ea6a33344ec48b93e7bae3895ecc12e85.tar.bz2 |
A first implementation of a Web API v3 client
-rw-r--r-- | SendGrid/Example/Example.csproj | 8 | ||||
-rw-r--r-- | SendGrid/Example/Program.cs | 57 | ||||
-rw-r--r-- | SendGrid/Example/app.config | 4 | ||||
-rw-r--r-- | SendGrid/SendGrid.sln | 25 | ||||
-rw-r--r-- | SendGrid/SendGrid/App.config | 14 | ||||
-rw-r--r-- | SendGrid/SendGrid/Client.cs | 126 | ||||
-rw-r--r-- | SendGrid/SendGrid/Properties/AssemblyInfo.cs | 36 | ||||
-rw-r--r-- | SendGrid/SendGrid/Resources/APIKeys.cs | 49 | ||||
-rw-r--r-- | SendGrid/SendGrid/SendGrid.csproj | 76 | ||||
-rw-r--r-- | SendGrid/SendGrid/packages.config | 5 | ||||
-rw-r--r-- | SendGrid/Tests/Tests.csproj | 4 | ||||
-rw-r--r-- | SendGrid/Tests/packages.config | 6 |
12 files changed, 394 insertions, 16 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj index 9569faf..60bede7 100644 --- a/SendGrid/Example/Example.csproj +++ b/SendGrid/Example/Example.csproj @@ -50,7 +50,10 @@ <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" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Web.Extensions" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
@@ -71,6 +74,11 @@ <Project>{3c687bef-ff50-44ad-8315-2d4237281af8}</Project>
<Name>Mail</Name>
</ProjectReference>
+ <ProjectReference Include="..\SendGrid\SendGrid.csproj">
+ <Project>{1c318867-440b-4eb9-99e3-c0cc2c556962}</Project>
+ <Name>SendGrid</Name>
+ <Aliases>global</Aliases>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs index 113e3f5..3e222a1 100644 --- a/SendGrid/Example/Program.cs +++ b/SendGrid/Example/Program.cs @@ -1,8 +1,9 @@ using System;
using System.Collections.Generic;
using System.Net;
+using System.Net.Http;
using System.Net.Mail;
-using SendGrid;
+using SendGrid.Resources;
namespace Example
{
@@ -10,11 +11,46 @@ namespace Example {
// this code is used for the SMTPAPI examples
private static void Main()
- {
+ {
+ String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User);
+ var client = new SendGrid.Client(apiKey);
+
+ // GET
+ HttpResponseMessage response = client.ApiKeys.Get();
+ Console.WriteLine(response.StatusCode);
+ Console.WriteLine(response.Content.ReadAsStringAsync().Result);
+ Console.ReadKey();
+
+ // POST
+ /*
+ HttpResponseMessage response = client.ApiKeys.Post("CSharpTestKey5");
+ Console.WriteLine(response.StatusCode);
+ Console.WriteLine(response.Content.ReadAsStringAsync().Result);
+ Console.ReadKey();
+ */
+
+ // DELETE
+ /*
+ HttpResponseMessage response = client.ApiKeys.Delete("<api_key_id>");
+ Console.WriteLine(response.StatusCode);
+ Console.WriteLine(response.Content.ReadAsStringAsync().Result);
+ Console.ReadKey();
+ */
+
+ // PATCH
+ /*
+ HttpResponseMessage response = client.ApiKeys.Patch("<api_key_id>", "CSharpTestKey7");
+ Console.WriteLine(response.StatusCode);
+ Console.WriteLine(response.Content.ReadAsStringAsync().Result);
+ Console.ReadKey();
+ */
+
+ // SEND EMAIL
+ /*
// Create the email object first, then add the properties.
- var myMessage = new SendGridMessage();
- myMessage.AddTo("anna@example.com");
- myMessage.From = new MailAddress("john@example.com", "John Smith");
+ var myMessage = new SendGrid.SendGridMessage();
+ myMessage.AddTo("elmer.thomas@sendgrid.com");
+ myMessage.From = new MailAddress("dx@sendgrid.com", "Elmer Thomas");
myMessage.Subject = "Testing the SendGrid Library";
myMessage.Text = "Hello World! %tag%";
@@ -23,17 +59,16 @@ namespace Example myMessage.AddSection("%type%", "とんこつ");
SendAsync(myMessage);
+ */
+ }
- Console.ReadLine();
- }
-
- private static async void SendAsync(SendGridMessage message)
+ private static async void SendAsync(SendGrid.SendGridMessage message)
{
// Create credentials, specifying your user name and password.
- var credentials = new NetworkCredential("username", "password");
+ var credentials = new NetworkCredential("<sendgrid_username>", "<sendgrid_password>");
// Create a Web transport for sending email.
- var transportWeb = new Web(credentials);
+ var transportWeb = new SendGrid.Web(credentials);
// Send the email.
try
diff --git a/SendGrid/Example/app.config b/SendGrid/Example/app.config index e7e5866..f05baaa 100644 --- a/SendGrid/Example/app.config +++ b/SendGrid/Example/app.config @@ -18,6 +18,10 @@ <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.18.0" newVersion="2.2.18.0" />
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
+ </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file diff --git a/SendGrid/SendGrid.sln b/SendGrid/SendGrid.sln index bc06242..8e75d76 100644 --- a/SendGrid/SendGrid.sln +++ b/SendGrid/SendGrid.sln @@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30501.0
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{0319E73A-7039-4858-B047-1EDF88BB6BD1}"
EndProject
@@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{DAC6CB EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mail", "SendGridMail\Mail.csproj", "{3C687BEF-FF50-44AD-8315-2D4237281AF8}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendGrid", "SendGrid\SendGrid.csproj", "{1C318867-440B-4EB9-99E3-C0CC2C556962}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
BuildNet45|Any CPU = BuildNet45|Any CPU
@@ -52,6 +54,7 @@ Global {F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.BuildNet45|x86.ActiveCfg = BuildNet45|Any CPU
{F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Debug|x86.ActiveCfg = Debug|Any CPU
{F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F39ADCE7-63B5-406D-9BE8-C407920B6B8F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -73,6 +76,24 @@ Global {3C687BEF-FF50-44AD-8315-2D4237281AF8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3C687BEF-FF50-44AD-8315-2D4237281AF8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3C687BEF-FF50-44AD-8315-2D4237281AF8}.Release|x86.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|Any CPU.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|Any CPU.Build.0 = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|Mixed Platforms.Build.0 = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|x86.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.BuildNet45|x86.Build.0 = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Debug|x86.Build.0 = Debug|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|x86.ActiveCfg = Release|Any CPU
+ {1C318867-440B-4EB9-99E3-C0CC2C556962}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/SendGrid/SendGrid/App.config b/SendGrid/SendGrid/App.config new file mode 100644 index 0000000..03260cb --- /dev/null +++ b/SendGrid/SendGrid/App.config @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> + </startup> + <runtime> + <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" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/SendGrid/SendGrid/Client.cs b/SendGrid/SendGrid/Client.cs new file mode 100644 index 0000000..0b27872 --- /dev/null +++ b/SendGrid/SendGrid/Client.cs @@ -0,0 +1,126 @@ +using System; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Reflection; +using System.Threading.Tasks; +using System.Text; +using SendGrid.Resources; +using System.Web.Script.Serialization; + +namespace SendGrid +{ + public class Client + { + private HttpResponseMessage _response; + private String _apiKey; + public Uri BaseUri; + public APIKeys ApiKeys; + + public Client(String api_key) + { + BaseUri = new Uri("https://api.sendgrid.com/"); + _apiKey = api_key; + ApiKeys = new APIKeys(this); + } + + async Task RequestAsync(String method, String endpoint, Object data) + { + using (var client = new HttpClient()) + { + try + { + client.BaseAddress = BaseUri; + client.DefaultRequestHeaders.Accept.Clear(); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey); + var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "sendgrid/" + version + ";csharp"); + StringContent content; + + switch (method.ToLower()) + { + case "get": + _response = await client.GetAsync(endpoint); + break; + case "post": + content = new StringContent(data.ToString(), Encoding.UTF8, "application/json"); + _response = await client.PostAsJsonAsync(endpoint, data); + break; + case "patch": + endpoint = BaseUri + endpoint.Remove(0, 1); + content = new StringContent(data.ToString(), Encoding.UTF8, "application/json"); + HttpRequestMessage request = new HttpRequestMessage + { + Method = new HttpMethod("PATCH"), + RequestUri = new Uri(endpoint), + Content = content + }; + _response = await client.SendAsync(request); + break; + case "delete": + _response = await client.DeleteAsync(endpoint); + break; + default: + _response = null; + break; + } + + if (_response == null) + { + //Console.WriteLine("Bad method call: " + method); + //Console.ReadKey(); + } + string responseBodyAsText = await _response.Content.ReadAsStringAsync(); + responseBodyAsText = responseBodyAsText.Replace("<br>", Environment.NewLine); + if (_response.IsSuccessStatusCode) + { + //Console.WriteLine(_response.StatusCode); + //Console.WriteLine(responseBodyAsText); + //Console.ReadKey(); + } + else + { + //Console.WriteLine(responseBodyAsText); + //Console.ReadKey(); + } + } + catch (HttpRequestException hre) + { + //Console.WriteLine(hre.ToString()); + //Console.ReadKey(); + } + catch (Exception ex) + { + //Console.WriteLine(ex.ToString()); + //Console.ReadKey(); + } + } + } + + public HttpResponseMessage Get(String endpoint) + { + RequestAsync("GET", endpoint, null).Wait(); + return _response; + } + + public HttpResponseMessage Post(String endpoint, object data) + { + RequestAsync("POST", endpoint, data).Wait(); + return _response; + } + + public HttpResponseMessage Delete(String endpoint) + { + RequestAsync("DELETE", endpoint, null).Wait(); + return _response; + } + + public HttpResponseMessage Patch(String endpoint, object data) + { + var json = new JavaScriptSerializer().Serialize(data); + RequestAsync("PATCH", endpoint, json).Wait(); + return _response; + } + + } +} diff --git a/SendGrid/SendGrid/Properties/AssemblyInfo.cs b/SendGrid/SendGrid/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ce788f2 --- /dev/null +++ b/SendGrid/SendGrid/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SendGrid")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SendGrid")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1c318867-440b-4eb9-99e3-c0cc2c556962")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SendGrid/SendGrid/Resources/APIKeys.cs b/SendGrid/SendGrid/Resources/APIKeys.cs new file mode 100644 index 0000000..ed10344 --- /dev/null +++ b/SendGrid/SendGrid/Resources/APIKeys.cs @@ -0,0 +1,49 @@ +using System; +using System.Net.Http; +using System.Web.Script.Serialization; + +namespace SendGrid.Resources +{ + + public class APIKeysData + { + public string name { get; set; } + } + + public class APIKeys + { + public string Name { get; set; } + public string Endpoint { get; set; } + private Client _client; + + public APIKeys(Client client) + { + Endpoint = "/v3/api_keys"; + _client = client; + + } + + public HttpResponseMessage Get() + { + return _client.Get(Endpoint); + } + + public HttpResponseMessage Post(String Name) + { + var Data = new APIKeysData() {name = Name}; + return _client.Post(Endpoint, Data); + } + + public HttpResponseMessage Delete(String ApiKeyID) + { + return _client.Delete(Endpoint + "/" + ApiKeyID); + } + + public HttpResponseMessage Patch(String ApiKeyID, String Name) + { + var Data = new APIKeysData() { name = Name }; + return _client.Patch(Endpoint + "/" + ApiKeyID, Data); + } + + } +} diff --git a/SendGrid/SendGrid/SendGrid.csproj b/SendGrid/SendGrid/SendGrid.csproj new file mode 100644 index 0000000..8bbed13 --- /dev/null +++ b/SendGrid/SendGrid/SendGrid.csproj @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{1C318867-440B-4EB9-99E3-C0CC2C556962}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SendGrid</RootNamespace> + <AssemblyName>SendGrid</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <TargetFrameworkProfile /> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <StartupObject /> + </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> + <Private>True</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="System.Web.Extensions" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Client.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Resources\APIKeys.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + </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> + --> +</Project>
\ No newline at end of file diff --git a/SendGrid/SendGrid/packages.config b/SendGrid/SendGrid/packages.config new file mode 100644 index 0000000..b24a212 --- /dev/null +++ b/SendGrid/SendGrid/packages.config @@ -0,0 +1,5 @@ +<?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" /> +</packages>
\ No newline at end of file diff --git a/SendGrid/Tests/Tests.csproj b/SendGrid/Tests/Tests.csproj index 41a2480..819c0d8 100644 --- a/SendGrid/Tests/Tests.csproj +++ b/SendGrid/Tests/Tests.csproj @@ -52,6 +52,10 @@ <Reference Include="Moq">
<HintPath>..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll</HintPath>
</Reference>
+ <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>
+ <Private>True</Private>
+ </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
diff --git a/SendGrid/Tests/packages.config b/SendGrid/Tests/packages.config index 43d88c0..deed6d7 100644 --- a/SendGrid/Tests/packages.config +++ b/SendGrid/Tests/packages.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?>
-
<packages>
- <package id="Moq" version="4.2.1402.2112" targetFramework="net40" />
- <package id="NUnit" version="2.6.3" targetFramework="net40" />
+ <package id="Moq" version="4.2.1402.2112" targetFramework="net4" />
+ <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="NUnit" version="2.6.3" targetFramework="net4" />
<package id="SendGrid.SmtpApi" version="1.3.1" targetFramework="net45" />
</packages>
\ No newline at end of file |