using System.Diagnostics.CodeAnalysis;

namespace Pilz.Data;

public interface IDataManager
{
    void Delete<T>(int id) where T : class, IDataObject;
    void Delete<T>(int id, bool save) where T : class, IDataObject;
    void Delete<T>(T? obj) where T : class, IDataObject;
    void Delete<T>(T? obj, bool save) where T : class, IDataObject;
    T? Find<T>(int id) where T : class, IDataObject;
    bool Find<T>(int id, [NotNullWhen(true)] out T? obj) where T : class, IDataObject;
    T? Find<T>(int? id) where T : class, IDataObject;
    bool Find<T>(int? id, [NotNullWhen(true)] out T? obj) where T : class, IDataObject;
    T FindOrNew<T>(int id) where T : class, IDataObject;
    bool FindOrNew<T>(int id, [NotNullWhen(true)] out T? obj) where T : class, IDataObject;
    T FindOrNew<T>(int? id) where T : class, IDataObject;
    bool FindOrNew<T>(int? id, [NotNullWhen(true)] out T? obj) where T : class, IDataObject;
    T? FindOrNull<T>(int id) where T : class, IDataObject;
    bool FindOrNull<T>(int id, out T? obj) where T : class, IDataObject;
    T? FindOrNull<T>(int? id) where T : class, IDataObject;
    bool FindOrNull<T>(int? id, out T? obj) where T : class, IDataObject;
    IQueryable<T> Get<T>() where T : class, IDataObject;
    void Save();
    void Save<T>(T obj) where T : class, IDataObject;
    void Save<T>(T obj, bool save) where T : class, IDataObject;
}