Skip to content

Commit 722a0ae

Browse files
committed
Merge pull request #71 from glennblock/dev
Fix for #58 and updating JSON.NET version.
2 parents 296d635 + 3f85153 commit 722a0ae

File tree

20 files changed

+104
-42
lines changed

20 files changed

+104
-42
lines changed

common/VersionInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
using System.Reflection;
1313

14-
[assembly: AssemblyVersion("0.1.1.0")]
15-
[assembly: AssemblyFileVersion("0.1.1.0")]
14+
[assembly: AssemblyVersion("0.6.0.0")]
15+
[assembly: AssemblyFileVersion("0.6.0.0")]

samples/friendapi/FriendApi.csproj

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,33 @@
3737
<Prefer32Bit>false</Prefer32Bit>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
40+
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
4141
<SpecificVersion>False</SpecificVersion>
42-
<HintPath>packages\Autofac.3.2.0\lib\net40\Autofac.dll</HintPath>
42+
<HintPath>packages\Autofac.3.5.0\lib\net40\Autofac.dll</HintPath>
4343
</Reference>
44-
<Reference Include="Autofac.Integration.WebApi, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
45-
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>packages\Autofac.WebApi2.3.2.0\lib\net45\Autofac.Integration.WebApi.dll</HintPath>
44+
<Reference Include="Autofac.Integration.WebApi">
45+
<HintPath>packages\Autofac.WebApi2.3.3.3\lib\net45\Autofac.Integration.WebApi.dll</HintPath>
46+
<Private>True</Private>
4747
</Reference>
48-
<Reference Include="Newtonsoft.Json">
49-
<HintPath>packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
48+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
49+
<HintPath>packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
5050
</Reference>
5151
<Reference Include="System" />
5252
<Reference Include="System.Core" />
5353
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
5454
<HintPath>packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath>
5555
</Reference>
56+
<Reference Include="System.Net.Http.Extensions">
57+
<HintPath>packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
58+
<Private>True</Private>
59+
</Reference>
5660
<Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57-
<SpecificVersion>False</SpecificVersion>
5861
<HintPath>packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
5962
</Reference>
63+
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
64+
<SpecificVersion>False</SpecificVersion>
65+
<HintPath>packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
66+
</Reference>
6067
<Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
6168
<HintPath>packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
6269
</Reference>
@@ -102,7 +109,9 @@
102109
</ItemGroup>
103110
<ItemGroup>
104111
<None Include="app.config" />
105-
<None Include="packages.config" />
112+
<None Include="packages.config">
113+
<SubType>Designer</SubType>
114+
</None>
106115
</ItemGroup>
107116
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
108117
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

samples/friendapi/app.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
1919
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
2020
</dependentAssembly>
21+
<dependentAssembly>
22+
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
23+
<bindingRedirect oldVersion="0.0.0.0-4.2.22.0" newVersion="4.2.22.0" />
24+
</dependentAssembly>
2125
</assemblyBinding>
2226
</runtime>
2327
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration>

samples/friendapi/packages.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Autofac" version="3.2.0" targetFramework="net45" />
4-
<package id="Autofac.WebApi2" version="3.2.0" targetFramework="net45" />
3+
<package id="Autofac" version="3.5.0" targetFramework="net45" />
4+
<package id="Autofac.WebApi2" version="3.3.3" targetFramework="net45" />
55
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.0" targetFramework="net45" />
66
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.0" targetFramework="net45" />
77
<package id="Microsoft.AspNet.WebApi.SelfHost" version="5.2.0" targetFramework="net45" />
8-
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
98
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
109
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
10+
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
11+
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
1112
</packages>

src/WebApiContrib.CollectionJson/Collection.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.Serialization;
45
using System.Text;
6+
using System.Xml;
57

68
namespace WebApiContrib.CollectionJson
79
{
10+
[DataContract]
811
public class Collection : ExtensibleObject
912
{
1013
public Collection()
@@ -15,36 +18,42 @@ public Collection()
1518
Template = new Template();
1619
}
1720

21+
[DataMember(Name="version")]
1822
public string Version
1923
{
2024
get { return GetValue<string>("Version"); }
2125
set { SetValue("Version", value); }
2226
}
2327

28+
[DataMember(Name = "href")]
2429
public Uri Href
2530
{
2631
get { return GetValue<Uri>("Href"); }
2732
set { SetValue("Href", value); }
2833
}
2934

35+
[DataMember(Name = "links")]
3036
public IList<Link> Links
3137
{
3238
get { return GetValue<IList<Link>>("Links"); }
3339
private set { SetValue("Links", value); }
3440
}
3541

42+
[DataMember(Name = "items")]
3643
public IList<Item> Items
3744
{
3845
get { return GetValue<IList<Item>>("Items"); }
3946
private set { SetValue("Items", value); }
4047
}
4148

49+
[DataMember(Name = "queries")]
4250
public IList<Query> Queries
4351
{
44-
get { return GetValue<IList<Query>>("Query"); }
45-
private set { SetValue("Query", value); }
52+
get { return GetValue<IList<Query>>("Queries"); }
53+
private set { SetValue("Queries", value); }
4654
}
4755

56+
[DataMember(Name = "template")]
4857
public Template Template
4958
{
5059
get { return GetValue<Template>("Template"); }

src/WebApiContrib.CollectionJson/Data.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.Serialization;
45
using System.Text;
56

67
namespace WebApiContrib.CollectionJson
78
{
9+
[DataContract]
810
public class Data : ExtensibleObject
911
{
12+
[DataMember(Name = "name")]
1013
public string Name
1114
{
1215
get { return GetValue<string>("Name"); }
1316
set { SetValue("Name", value); }
1417
}
1518

19+
[DataMember(Name = "value")]
1620
public string Value
1721
{
1822
get { return GetValue<string>("Value"); }
1923
set { SetValue("Value", value); }
2024
}
2125

26+
[DataMember(Name = "prompt")]
2227
public string Prompt
2328
{
2429
get { return GetValue<string>("Prompt"); }
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.Serialization;
45
using System.Text;
56

67
namespace WebApiContrib.CollectionJson
78
{
8-
9+
[DataContract]
910
public class Error
1011
{
12+
[DataMember(Name = "title")]
1113
public string Title { get; set; }
14+
15+
[DataMember(Name = "code")]
1216
public string Code { get; set; }
17+
18+
[DataMember(Name = "message")]
1319
public string Message { get; set; }
1420
}
1521
}

src/WebApiContrib.CollectionJson/ExtensibleObject.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Dynamic;
45
using System.Linq;
56
using System.Reflection;
@@ -46,7 +47,8 @@ public T GetValue<T>(string key)
4647
{
4748
object val;
4849
var found = Members.TryGetValue(key, out val);
49-
if (found)
50+
51+
if (found)
5052
return (T) val;
5153

5254
return default(T);

src/WebApiContrib.CollectionJson/Item.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.Serialization;
45
using System.Text;
56

67
namespace WebApiContrib.CollectionJson
78
{
9+
[DataContract]
810
public class Item : ExtensibleObject
911
{
1012
public Item()
@@ -13,30 +15,35 @@ public Item()
1315
Links = new List<Link>();
1416
}
1517

18+
[DataMember(Name = "href")]
1619
public Uri Href
1720
{
1821
get { return GetValue<Uri>("Href"); }
1922
set { SetValue("Href", value); }
2023
}
2124

25+
[DataMember(Name = "rel")]
2226
public string Rel
2327
{
2428
get { return GetValue<string>("Rel"); }
2529
set { SetValue("Rel", value); }
2630
}
2731

32+
[DataMember(Name = "rt")]
2833
public string Rt
2934
{
3035
get { return GetValue<string>("Rt"); }
3136
set { SetValue("Rt", value); }
3237
}
3338

39+
[DataMember(Name = "data")]
3440
public IList<Data> Data
3541
{
3642
get { return GetValue<IList<Data>>("Data"); }
3743
private set { SetValue("Data", value); }
3844
}
3945

46+
[DataMember(Name = "links")]
4047
public IList<Link> Links
4148
{
4249
get { return GetValue<IList<Link>>("Links"); }

src/WebApiContrib.CollectionJson/Link.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.Serialization;
45
using System.Text;
56

67
namespace WebApiContrib.CollectionJson
78
{
9+
[DataContract]
810
public class Link : ExtensibleObject
911
{
12+
[DataMember(Name = "rel")]
1013
public String Rel
1114
{
1215
get { return GetValue<String>("Rel"); }
1316
set { SetValue("Rel", value); }
1417
}
1518

19+
[DataMember(Name = "href")]
1620
public Uri Href
1721
{
1822
get { return GetValue<Uri>("Href"); }
1923
set { SetValue("Href", value); }
2024
}
2125

26+
[DataMember(Name = "prompt")]
2227
public String Prompt
2328
{
2429
get { return GetValue<String>("Prompt"); }
2530
set { SetValue("Promot", value); }
2631
}
2732

33+
[DataMember(Name = "render")]
2834
public String Render
2935
{
3036
get { return GetValue<String>("Render"); }

0 commit comments

Comments
 (0)