예제 #1
0
 protected static void Vacuum()
 {
     lock (_saveChangesLockObject)
     {
         GenericDbContext.Vacuum();
     }
 }
예제 #2
0
 public static void Sql(string sql)
 {
     lock (_saveChangesLockObject)
     {
         GenericDbContext.Sql(sql);
     }
 }
예제 #3
0
 protected static void Drop()
 {
     lock (_saveChangesLockObject)
     {
         GenericDbContext.Truncate();
     }
 }
예제 #4
0
        protected GenericContext(string contextName)
        {
            _context = new GenericDbContext(contextName);

            _context.BeforeSetChanged += (sender, args) => OnBeforeSetChanged(args.Entity, args.State);
            _context.AfterSetChanged  += (sender, args) => OnAfterSetChanged(args.Entity, args.State);

            FillContextRepositoriesAndLookup();

            lock (Contextes)
                Contextes.Add(this);
        }