#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Models.Core;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Domain.Common.ValueObjects.Metadata;
///
/// Value Object for the genres of a media element.
///
[DebuggerDisplay("{Name}")]
public class Genre : ValueObject
{
///
/// Gets the name of the genre element of the media item.
///
public string Name { get; }
///
/// Initializes a new instance of the class.
///
/// The value representing this object.
private Genre(string name)
{
Name = name.Trim();
}
///
/// Creates a new instance of the class.
///
/// The value of the genre.
///
/// An containing either a successfully created , or an error message.
///
public static Result Create(string name)
{
if (string.IsNullOrWhiteSpace(name))
return Errors.Errors.Metadata.GenreNameCannotBeEmpty;
return new Genre(name);
}
///
/// Gets the list of items that define equality of the object.
///
/// A list of items defining the equality.
public override IEnumerable