public virtual List <DbTipster> GetTipstersExceptDefault() { var me = DbTipster.Me(); var dbTipsters = _db.Tipsters.Include(t => t.Website.Login).Where(t => t.Id != me.Id).OrderBy(t => t.Name).ToList(); //foreach (var t in dbTipsters) // db.Entry(t.Website).Reference(e => e.Login).Load(); // zamiast explicitly loading tutaj, eager loading u góry, zostawione dla odniesienia return(dbTipsters); }
public virtual List <DbTipster> GetTipstersExceptDefaultById(params int[] ids) { if (!ids.Any()) { return(new List <DbTipster>()); } var me = DbTipster.Me(); return(_db.Tipsters.Include(t => t.Website.Login).WhereByMany(t => t.Id, ids).Where(t => t.Id != me.Id).ToList()); }
public virtual void EnsureDefaultTipsterExists() { var me = DbTipster.Me(); if (_db.Tipsters.Any(t => t.Id == me.Id)) { return; } _db.Tipsters.Add(me); _db.SaveChanges(); }
public void UpsertMyBet(DbBet bet, bool addOnly = false) { UpsertBet(DbTipster.Me(), bet, addOnly); }
public void UpsertMyBets(List <DbBet> bets, bool addOnly = false) { UpsertBets(DbTipster.Me(), bets, addOnly); }