30 lines
839 B
C#
30 lines
839 B
C#
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;
|
|
}
|
|
}
|
|
}
|