2024-05-12 11:43:23 +00:00
|
|
|
|
namespace EllieBot.Marmalade;
|
2024-03-23 05:42:46 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-07-07 13:28:26 +00:00
|
|
|
|
/// Marks the class as a service which can be used within the same Marmalade
|
2024-03-23 05:42:46 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
public class svcAttribute : Attribute
|
|
|
|
|
{
|
|
|
|
|
public Lifetime Lifetime { get; }
|
|
|
|
|
public svcAttribute(Lifetime lifetime)
|
|
|
|
|
{
|
|
|
|
|
Lifetime = lifetime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Lifetime for <see cref="svcAttribute"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum Lifetime
|
|
|
|
|
{
|
|
|
|
|
Singleton,
|
|
|
|
|
Transient
|
|
|
|
|
}
|