public EntityManager(EntityManagerInitiateModel data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } if (string.IsNullOrWhiteSpace(data.Constring)) { throw new Exception("Can not initialize database connection."); } DbContext = new CvkmpContext(data.Constring); InitiatorData = data; }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { DbContext?.Dispose(); InitiatorData = null; ReleaseUnmanagedResources(); } disposedValue = true; } }