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:
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user