init
This commit is contained in:
30
Kreta.Core/CustomAttributes/ColumnNameAttribute.cs
Normal file
30
Kreta.Core/CustomAttributes/ColumnNameAttribute.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
|
||||
namespace Kreta.Core.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class ColumnNameAttribute : Attribute
|
||||
{
|
||||
public string[] ColumnName { get; private set; }
|
||||
|
||||
public ColumnNameAttribute(params string[] columnNames)
|
||||
{
|
||||
if (columnNames == null || columnNames.Length == 0)
|
||||
{
|
||||
throw new BlException(BlExceptionType.ListaNemTartalmazElemet);
|
||||
}
|
||||
|
||||
foreach (string columnName in columnNames)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(columnName))
|
||||
{
|
||||
throw new BlException(BlExceptionType.ValtozoErtekeNemLehetNull);
|
||||
}
|
||||
}
|
||||
|
||||
ColumnName = columnNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user