示例#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);
        }