Skip to content

Commit

Permalink
Added NuGet package. Changed to JSON.Net
Browse files Browse the repository at this point in the history
  • Loading branch information
brooklynDev committed Sep 3, 2012
1 parent d92b4d1 commit 0bb3304
Show file tree
Hide file tree
Showing 23 changed files with 51,285 additions and 23 deletions.
6 changes: 0 additions & 6 deletions NGon.SampleApplication/NGon.SampleApplication.csproj
Expand Up @@ -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" />
Expand Down Expand Up @@ -87,9 +84,6 @@
<Name>NGon</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup>
Expand Down
33 changes: 19 additions & 14 deletions NGon.SampleApplication/Web.config
@@ -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>
Expand All @@ -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>
Expand All @@ -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>
5 changes: 2 additions & 3 deletions NGon/HtmlHelperExtensions.cs
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using Newtonsoft.Json;

namespace NGon
{
Expand All @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions NGon/NGon.csproj
Expand Up @@ -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" />
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions NGon/packages.config
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="4.5.8" targetFramework="net40" />
</packages>
Binary file added NuGet/NGon.1.0.0.nupkg
Binary file not shown.
18 changes: 18 additions & 0 deletions NuGet/NGon.dll.nuspec
@@ -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.

0 comments on commit 0bb3304

Please sign in to comment.