Cleaned up the startup sequence.

This commit is contained in:
Masu Baumgartner
2024-10-28 21:30:00 +01:00
parent f6ed12fc7a
commit e02af774a9
10 changed files with 402 additions and 166 deletions

View File

@@ -0,0 +1,17 @@
using System.Collections;
namespace Moonlight.ApiServer.Helpers;
public class DatabaseContextCollection : IEnumerable<Type>
{
private readonly List<Type> Types = new();
public IEnumerator<Type> GetEnumerator() => Types.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => Types.GetEnumerator();
public void Add<T>() where T : DatabaseContext
=> Types.Add(typeof(T));
public void Remove(Type type) => Types.Remove(type);
public void Remove<T>() where T : DatabaseContext => Remove(typeof(T));
}