namespace Core.Blueprint.Mongo
{
///
/// The attribute is used to specify the name of a MongoDB collection
/// that a class should be mapped to. This attribute can be applied to classes that represent MongoDB entities.
///
[AttributeUsage(AttributeTargets.Class)] // This attribute can only be applied to classes.
public class CollectionAttributeName : Attribute
{
///
/// Gets or sets the name of the MongoDB collection that the class is mapped to.
///
public string Name { get; set; }
///
/// Initializes a new instance of the class with the specified collection name.
///
/// The name of the MongoDB collection that the class should be mapped to.
public CollectionAttributeName(string name)
{
Name = name ?? throw new ArgumentNullException(nameof(name), "Collection name cannot be null.");
}
}
}