Пример #1
0
 public IEnumerable <Player> AllPlayers()
 {
     using (var context = new ShowContext(CONNECTION_NAME))
     {
         return(context.Players.ToList());
     }
 }
Пример #2
0
        public bool DeleteById(int id)
        {
            using (var context = new ShowContext(CONNECTION_NAME))
            {
                var existing = context.Briefcases.FirstOrDefault(a => a.BriefCaseId == id);
                if (existing == null)
                {
                    return(false);
                }

                context.Briefcases.Remove(existing);
                return(context.SaveChanges() > 0);
            }
        }