Permalink
Browse files

Added NuGet package. Changed to JSON.Net

  • Loading branch information...
1 parent d92b4d1 commit 0bb33048a808419e491c7304711190899595b739 @brooklynDev committed Sep 3, 2012
@@ -34,9 +34,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="EntityFramework">
- <HintPath>..\packages\EntityFramework.4.1.10331.0\lib\EntityFramework.dll</HintPath>
- </Reference>
<Reference Include="System.Data.Entity" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
@@ -87,9 +84,6 @@
<Name>NGon</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Content Include="packages.config" />
- </ItemGroup>
<ItemGroup>
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup>
@@ -1,16 +1,18 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
-
<configuration>
+ <configSections>
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ </configSections>
<appSettings>
- <add key="webpages:Version" value="1.0.0.0"/>
- <add key="ClientValidationEnabled" value="true"/>
- <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
+ <add key="webpages:Version" value="1.0.0.0" />
+ <add key="ClientValidationEnabled" value="true" />
+ <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
-
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
@@ -21,28 +23,24 @@
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
-
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
-
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
- <add namespace="System.Web.WebPages"/>
+ <add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
-
<system.webServer>
- <validation validateIntegratedModeConfiguration="false"/>
- <modules runAllManagedModulesForAllRequests="true"/>
+ <validation validateIntegratedModeConfiguration="false" />
+ <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
-
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@@ -51,4 +49,11 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
-</configuration>
+ <entityFramework>
+ <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+ <parameters>
+ <parameter value="v11.0" />
+ </parameters>
+ </defaultConnectionFactory>
+ </entityFramework>
+</configuration>
@@ -4,7 +4,7 @@
using System.Text;
using System.Web;
using System.Web.Mvc;
-using System.Web.Script.Serialization;
+using Newtonsoft.Json;
namespace NGon
{
@@ -29,10 +29,9 @@ public static IHtmlString IncludeNGon(this HtmlHelper helper, string @namespace
var builder = new StringBuilder();
builder.AppendFormat("window.{0}={{}};", @namespace);
- var serializer = new JavaScriptSerializer();
foreach (var prop in ngon)
{
- builder.AppendFormat("{0}.{1}={2};", @namespace, prop.Key, helper.Raw(serializer.Serialize(prop.Value)));
+ builder.AppendFormat("{0}.{1}={2};", @namespace, prop.Key, helper.Raw(JsonConvert.SerializeObject(prop.Value)));
}
tag.InnerHtml = builder.ToString();
View
@@ -31,6 +31,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.8\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
@@ -48,6 +51,9 @@
<Compile Include="NGonActionFilterAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </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.
View
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.5.8" targetFramework="net40" />
+</packages>
View
Binary file not shown.
View
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<package >
+ <metadata>
+ <id>NGon</id>
+ <version>1.0.0</version>
+ <authors>Alex Friedman</authors>
+ <owners>Alex Friedman</owners>
+ <projectUrl>https://github.com/brooklynDev/NGon</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>Share your ASP.Net MVC server side Controller data with your client side JavaScript.</description>
+ <releaseNotes>Updated serializer to JSON.Net</releaseNotes>
+ <copyright>Copyright 2012</copyright>
+ <tags>mvc json</tags>
+ <dependencies>
+ <dependency id="Newtonsoft.Json" version="1.0" />
+ </dependencies>
+ </metadata>
+</package>
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 0bb3304

Please sign in to comment.