mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Fixed the issues where the DB was being disposed too early
This commit is contained in:
parent
47f323fcdd
commit
96e3e88261
16 changed files with 86 additions and 91 deletions
|
@ -12,5 +12,10 @@ namespace Ombi.Store.Context.MySql
|
|||
|
||||
Database.Migrate();
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -107,25 +107,25 @@ namespace Ombi.Store.Repository
|
|||
}
|
||||
|
||||
|
||||
private bool _disposed;
|
||||
// Protected implementation of Dispose pattern.
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
//private bool _disposed;
|
||||
//// Protected implementation of Dispose pattern.
|
||||
//protected virtual void Dispose(bool disposing)
|
||||
//{
|
||||
// if (_disposed)
|
||||
// return;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
_ctx?.Dispose();
|
||||
}
|
||||
// if (disposing)
|
||||
// {
|
||||
// _ctx?.Dispose();
|
||||
// }
|
||||
|
||||
_disposed = true;
|
||||
}
|
||||
// _disposed = true;
|
||||
//}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
//public void Dispose()
|
||||
//{
|
||||
// Dispose(true);
|
||||
// GC.SuppressFinalize(this);
|
||||
//}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ using Ombi.Store.Entities;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IExternalRepository<T> : IDisposable where T : Entity
|
||||
public interface IExternalRepository<T> where T : Entity
|
||||
{
|
||||
Task<T> Find(object key);
|
||||
IQueryable<T> GetAll();
|
||||
|
|
|
@ -9,7 +9,7 @@ using Ombi.Store.Entities;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IRepository<T> : IDisposable where T : Entity
|
||||
public interface IRepository<T> where T : Entity
|
||||
{
|
||||
Task<T> Find(object key);
|
||||
IQueryable<T> GetAll();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue