Esempio n. 1
0
 public bool VoegTeamToe(Team team)
 {
     using (var context = new TeamDbContext())
     {
         try
         {
             if (!context.Teams.Contains(team))
             {
                 context.Teams.Add(team);
                 context.SaveChanges();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
             return(false);
         }
     }
 }