internal static void CheckItem <TRelatedEntity>(this EntityUnique <TRelatedEntity> EntityUnique, TRelatedEntity RelatedEntity) where TRelatedEntity : Entity <TRelatedEntity> { if (EntityUnique.Entity != RelatedEntity) { EntityUnique.ThrowEntityUniqueException($"Expect Item Be {RelatedEntity}"); } }
private static void ThrowEntityUniqueException <TRelatedEntity>(this EntityUnique <TRelatedEntity> EntityUnique, string Message) where TRelatedEntity : Entity <TRelatedEntity> { throw new NotExpectedResultException($"{EntityUnique}, {Message}"); }