Refactoring usage of DatabaseType - more convention based.

Limiting the use of the DatabaseType, so its only used for NText and NChar.
Adding LengthAttribute for fixed sized columns.
This commit is contained in:
sitereactor
2012-10-22 12:52:29 -02:00
parent b3d8b4c53c
commit 2545de57e0
32 changed files with 83 additions and 66 deletions

View File

@@ -1,16 +0,0 @@
using System;
namespace Umbraco.Core.Persistence.DatabaseAnnotations
{
[AttributeUsage(AttributeTargets.Property)]
public class DatabaseTypeAttribute : Attribute
{
public DatabaseTypeAttribute(SpecialDbTypes databaseType)
{
DatabaseType = databaseType;
}
public SpecialDbTypes DatabaseType { get; set; }
public int Length { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace Umbraco.Core.Persistence.DatabaseAnnotations
{
[AttributeUsage(AttributeTargets.Property)]
public class LengthAttribute : Attribute
{
public LengthAttribute(int length)
{
Length = length;
}
public int Length { get; private set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace Umbraco.Core.Persistence.DatabaseAnnotations
{
[AttributeUsage(AttributeTargets.Property)]
public class SpecialDbTypeAttribute : Attribute
{
public SpecialDbTypeAttribute(SpecialDbTypes databaseType)
{
DatabaseType = databaseType;
}
public SpecialDbTypes DatabaseType { get; private set; }
}
}