Exemple #1
0
        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;
        }
Exemple #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    DbContext?.Dispose();

                    InitiatorData = null;

                    ReleaseUnmanagedResources();
                }

                disposedValue = true;
            }
        }