using System;
using AMWD.Common.EntityFrameworkCore.Extensions;
using Microsoft.EntityFrameworkCore;
namespace AMWD.Common.EntityFrameworkCore.Attributes
{
///
/// Property attribute to create indices and unique constraints in the database.
///
///
/// Requires to be called within .
///
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public class DatabaseIndexAttribute : Attribute
{
///
/// Initializes a new instance of the class.
///
public DatabaseIndexAttribute()
{
Name = null;
IsUnique = false;
}
///
/// Gets or sets a name.
///
public string Name { get; set; }
///
/// Gets or sets a value indicating whether it is a unique constraint.
///
public bool IsUnique { get; set; }
}
}