Explorar o código

Updated ASP.NET packages

* No longer using a beta version of Entity Framework 6
* No longer using a custom build of the MySQL driver for EF6
* Updated ASP.NET MVC Framework from v4 to 5.1.0
* Updated other libraries to their latest versions
Pēteris Ņikiforovs %!s(int64=11) %!d(string=hai) anos
pai
achega
40ce2163c2

+ 5 - 5
aspnet/README.md

@@ -29,14 +29,14 @@
 **Web Stack**
 
 * ASP.NET 4.5
-* ASP.NET MVC Framework 4
+* ASP.NET MVC Framework 5.1.0
 
 **Databases**
 
-* MySQL Connector/Net 6.7.2-beta ([custom build](https://github.com/pdonald/mysql-connector-net))
-* Npgsql 2.0.13-beta1
-* Entity Framework 6.0.0-beta1
-* Mongo C# Driver 1.8.2
+* MySQL Connector/Net 6.8.3
+* Npgsql 2.0.14.3
+* Entity Framework 6.0.2
+* Mongo C# Driver 1.8.3
 
 **Developer Tools**
 

+ 10 - 9
aspnet/lib/packages.config

@@ -1,14 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="EntityFramework" version="6.0.0-beta1" targetFramework="net45" />
-  <package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
-  <package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
-  <package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net45" />
+  <package id="EntityFramework" version="6.0.2" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Mvc" version="5.1.0" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Razor" version="3.1.0" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebPages" version="3.1.0" targetFramework="net45" />
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
   <package id="MSBuild.Microsoft.VisualStudio.Web.targets" version="11.0.2.1" />
-  <package id="mongocsharpdriver" version="1.8.2" targetFramework="net45" />
-  <package id="MySql.Data.Entity" version="6.7.2-beta-ef6" targetFramework="net45" />
-  <package id="Npgsql" version="2.0.13-beta1" targetFramework="net45" />
-  <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
-  <package id="ServiceStack.Text" version="3.9.56" targetFramework="net45" />
+  <package id="mongocsharpdriver" version="1.8.3" targetFramework="net45" />
+  <package id="MySql.Data" version="6.8.3" targetFramework="net45" />
+  <package id="MySql.Data.Entities" version="6.8.3" targetFramework="net45" />
+  <package id="Npgsql" version="2.0.14.3" targetFramework="net45" />
+  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
+  <package id="ServiceStack.Text" version="4.0.8" targetFramework="net45" />
 </packages>

+ 16 - 16
aspnet/src/Benchmarks.AspNet.csproj

@@ -45,69 +45,69 @@
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Web.Mvc">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.Mvc.5.1.0\lib\net45\System.Web.Mvc.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Helpers">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.Helpers.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.Razor.3.1.0\lib\net45\System.Web.Razor.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Deployment">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
+      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Web.Infrastructure">
       <Private>True</Private>
       <HintPath>..\lib\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json">
-      <HintPath>..\lib\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <HintPath>..\lib\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="ServiceStack.Text">
-      <HintPath>..\lib\ServiceStack.Text.3.9.56\lib\net35\ServiceStack.Text.dll</HintPath>
+      <HintPath>..\lib\ServiceStack.Text.4.0.8\lib\net40\ServiceStack.Text.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.0-beta1\lib\net45\EntityFramework.dll</HintPath>
+      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.0-beta1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.SqlServer.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.Entity.6.7.2-beta-ef6\lib\net45\MySql.Data.dll</HintPath>
+      <HintPath>..\lib\MySql.Data.6.8.3\lib\net45\MySql.Data.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.Entity.6.7.2-beta-ef6\lib\net45\MySql.Data.Entity.dll</HintPath>
+      <HintPath>..\lib\MySql.Data.Entities.6.8.3\lib\net45\mysql.data.entity.EF6.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.13-beta1\lib\net45\Npgsql.dll</HintPath>
+      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Npgsql.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.13-beta1\lib\net45\Mono.Security.dll</HintPath>
+      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Mono.Security.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.2\lib\net35\MongoDB.Bson.dll</HintPath>
+      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Bson.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.2\lib\net35\MongoDB.Driver.dll</HintPath>
+      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Driver.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

+ 5 - 22
aspnet/src/Models/EntityFramework.cs

@@ -1,10 +1,5 @@
-using System;
 using System.Data.Entity;
-using System.Data.Entity.ModelConfiguration.Configuration;
-using System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive;
-using System.Data.Entity.ModelConfiguration.Configuration.Types;
 using System.Data.Entity.ModelConfiguration.Conventions;
-using System.Reflection;
 
 namespace Benchmarks.AspNet.Models
 {
@@ -28,27 +23,15 @@ namespace Benchmarks.AspNet.Models
             modelBuilder.Ignore<MongoWorld>();
             
             if (Database.Connection is Npgsql.NpgsqlConnection)
-                modelBuilder.Conventions.Add<PostgreSqlConfigurationConvention>();
+                modelBuilder.Conventions.Add(new PostgreSqlConfigurationConvention());
         }
         
-        private class PostgreSqlConfigurationConvention
-            : IConfigurationConvention<Type, EntityTypeConfiguration>, 
-              IConfigurationConvention<PropertyInfo, PrimitivePropertyConfiguration>,
-              IConfigurationConvention<Type, ModelConfiguration>
+        private class PostgreSqlConfigurationConvention : Convention
         {
-            public void Apply(Type memberInfo, Func<EntityTypeConfiguration> configuration)
+            public PostgreSqlConfigurationConvention()
             {
-                configuration().ToTable(memberInfo.Name.ToLowerInvariant(), null);
-            }
-            
-            public void Apply(PropertyInfo memberInfo, Func<PrimitivePropertyConfiguration> configuration)
-            {
-                configuration().ColumnName = memberInfo.Name.ToLowerInvariant();
-            }
-            
-            public void Apply(Type memberInfo, Func<ModelConfiguration> configuration)
-            {
-                configuration().DefaultSchema = "public";
+                Properties().Configure(p => p.HasColumnName(p.ClrPropertyInfo.Name.ToLowerInvariant()));
+                Types().Configure(c => c.ToTable(c.ClrType.Name.ToLowerInvariant(), "public"));
             }
         }
     }