From PetaPoco to NPoco (#1207)

* NPoco - 2.x (builds)

* NPoco - v3.1 (does not build)

* NPoco - builds

* NPoco - configure database factory (tests fail)

* Pick fix from 7.4

* NPoco - stock v3.1 - sort-of working

* NPoco - fix merge

* Fix Newtonsoft.Json in web.Template.Debug.config

* NPoco - fix SELECT *

* NPoco - fixing repositories

* NPoco - fix EntityRepository

* NPoco - fix EntityRepository

* NPoco - cosmetic

* NPoco - use 3.1.0-u001 from github/zpqrtbnk/NPoco

* Fixes build, NPoco needed to be referenced in the cms and UmbracoExamine projects

* Fixes lots of tests

* fixes more tests

* NPoco - bugfixing

* Bugfix CacheHelper in tests

* Bugfix connection mocking in tests

* NPoco - inject database in Sql.Select<>

* NPoco - discovery retry policy only once

* Enable C# 6 for Umbraco.Core

* NPoco - introduce UmbracoSql, cleanup

* NPoco - more cleanup and fixing

* NPoco - fix UserRepository

* Optimize InGroupsOf

* Implement UmbracoDatabase.FetchByGroups

* NPoco - fix Select

* NPoco - simplify GetPagedResultsByQuery

* Cherry-pick DisableBrowserCacheAttribute fix from 7.4

* Upgrade NPoco to use Sql<TContext>

* U4-8257 - cleanup relators

* 4-8257 - cleanup more relators

* Upgrade NPoco with more OOTB version

* fixes a couple tests, changes double check lock to Lazy<T>
This commit is contained in:
Stephan
2016-04-12 15:11:07 +02:00
committed by Shannon Deminick
parent 1b8747bd6d
commit 365a01a476
236 changed files with 4327 additions and 6705 deletions

View File

@@ -2,6 +2,7 @@
using System.Data;
using System.Linq;
using System.Reflection;
using NPoco;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -11,7 +12,7 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
{
public static TableDefinition GetTableDefinition(Type modelType, ISqlSyntaxProvider sqlSyntax)
{
//Looks for PetaPoco's TableNameAtribute for the name of the table
//Looks for NPoco's TableNameAtribute for the name of the table
//If no attribute is set we use the name of the Type as the default convention
var tableNameAttribute = modelType.FirstAttribute<TableNameAttribute>();
string tableName = tableNameAttribute == null ? modelType.Name : tableNameAttribute.Value;
@@ -108,7 +109,7 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
var constraintAttribute = propertyInfo.FirstAttribute<ConstraintAttribute>();
if (constraintAttribute != null)
{
//Special case for MySQL as it can't have multiple default DateTime values, which
//Special case for MySQL as it can't have multiple default DateTime values, which
//is what the umbracoServer table definition is trying to create
if (sqlSyntax is MySqlSyntaxProvider && definition.TableName == "umbracoServer" &&
definition.TableName.ToLowerInvariant() == "lastNotifiedDate".ToLowerInvariant())