Exemple #1
0
        public DbError UpdateTournament(TournamentModel tournament)
        {
            using (var db = new VictoriousEntities())
            {
                try
                {
                    TournamentModel _tournament = db.TournamentModels.Find(tournament.TournamentID);
                    db.Entry(_tournament).CurrentValues.SetValues(tournament);

                    //foreach (var bracket in _tournament.Brackets)
                    //{
                    //    foreach (var match in bracket.Matches)
                    //    {
                    //        match.Challenger = db.TournamentUserModels.Find(match.ChallengerID);
                    //        match.Defender = db.TournamentUserModels.Find(match.DefenderID);
                    //    }
                    //}
                }
                catch (Exception ex)
                {
                    exception = ex;
                    WriteException(ex);
                    return(DbError.FAILED_TO_UPDATE);
                }
                return(DbError.SUCCESS);
            }
        }
 public UnitOfWork(string name = null, VictoriousEntities context = null)
 {
     if (name != null)
     {
         context = new VictoriousEntities(name);
         context.Configuration.AutoDetectChangesEnabled = true;
     }
     if (context != null)
     {
         this.context = context;
     }
     //this.context.Configuration.AutoDetectChangesEnabled = false;
 }
 public BracketTypeRepository(VictoriousEntities context)
 {
     this.context = context;
 }
 public BracketTypeRepository()
 {
     context = new VictoriousEntities();
 }
Exemple #5
0
 public TournamentRepository(VictoriousEntities context)
 {
     this.context = context;
 }
 public void Refresh()
 {
     context.Dispose();
     context = new VictoriousEntities();
 }
 public MatchRepository()
 {
     context = new VictoriousEntities();
 }
 public MatchRepository(VictoriousEntities context)
 {
     this.context = context;
 }
 public PlatformRepository(VictoriousEntities context)
 {
     this.context = context;
 }
 public Repository(VictoriousEntities _context)
 {
     this.context = _context;
     context.Configuration.AutoDetectChangesEnabled = true;
     this.dbSet = context.Set <TEntity>();
 }
 public PlatformRepository()
 {
     context = new VictoriousEntities();
 }
 public AccountRepository(VictoriousEntities context)
 {
     this.context = context;
 }
 public AccountRepository()
 {
     context = new VictoriousEntities();
 }
Exemple #14
0
 public GameTypeRepository(VictoriousEntities context)
 {
     this.context = context;
 }
Exemple #15
0
 public GameTypeRepository()
 {
     context = new VictoriousEntities();
 }