Ejemplo n.º 1
0
 public List <Teams> ListTeams()
 {
     using (var db = new SupenEntities())
     {
         var listTeams = db.Teams.ToList();
         return(listTeams);
     }
 }
Ejemplo n.º 2
0
 public Teams GetTeam(Guid id, string teamName)
 {
     using (var db = new SupenEntities())
     {
         var getTeam = db.Teams.Where(t => t.TeamId == id && t.TeamName == teamName).FirstOrDefault();
         return(getTeam);
     }
 }
Ejemplo n.º 3
0
 public List <AppUser> SearchUser(string search)
 {
     using (var db = new SupenEntities())
     {
         var searchuser = db.AppUser.Where(a => a.Email.Contains(search)).ToList();
         return(searchuser);
     }
 }
Ejemplo n.º 4
0
 public AppUser GetMyProfile(Guid id)
 {
     using (var db = new SupenEntities())
     {
         var getId = db.AppUser.Where(a => a.AppUserId == id).FirstOrDefault();
         return(getId);
     }
 }
Ejemplo n.º 5
0
 public AppUser(Guid id)
 {
     using (var db = new SupenEntities())
     {
         var repos   = new AppUserRepos();
         var getUser = repos.GetAppUser(id);
         AppUserId = id;
     }
 }
Ejemplo n.º 6
0
 public Teams(Guid id, string teamName)
 {
     using (var db = new SupenEntities())
     {
         var repos = new TeamRepos();
         var team  = repos.GetTeam(id, teamName);
         TeamId   = id;
         TeamName = teamName;
     }
 }
Ejemplo n.º 7
0
 public AppUser UpdateValues(string firstName, string lastName, int age, Guid id)
 {
     using (var db = new SupenEntities())
     {
         var user = db.AppUser.FirstOrDefault(a => a.AppUserId == id);
         user.FirstName = firstName;
         user.LastName  = lastName;
         user.Age       = age;
         db.SaveChanges();
         return(user);
     }
 }
Ejemplo n.º 8
0
 public Teams CreateTeam(string teamName)
 {
     using (var db = new SupenEntities())
     {
         var team = new Teams
         {
             TeamId   = Guid.NewGuid(),
             TeamName = teamName
         };
         db.Teams.Add(team);
         db.SaveChanges();
         return(team);
     }
 }
Ejemplo n.º 9
0
 public bool CreateBlogPost(string text, string category, Guid id)
 {
     using (var db = new SupenEntities())
     {
         var repos = new AppUserRepos();
         var bp    = new Blogg();
         bp.BloggId   = Guid.NewGuid();
         bp.Category  = category;
         bp.Text      = text;
         bp.AppUserId = id;
         db.Blogg.Add(bp);
         db.SaveChanges();
     }
     return(true);
 }
Ejemplo n.º 10
0
 public Games addGames(string hometeam, string awayteam, int?homescore, int?awayscore)
 {
     using (var db = new SupenEntities())
     {
         var addGame = new Games
         {
             GameId    = Guid.NewGuid(),
             HomeTeam  = hometeam,
             AwayTeam  = awayteam,
             HomeScore = homescore,
             AwayScore = awayscore,
         };
         db.Games.Add(addGame);
         db.SaveChanges();
         return(addGame);
     }
 }
Ejemplo n.º 11
0
 public bool AddUser(string FirstName, string LastName, int Age, string Email, string Password)
 {
     using (var db = new SupenEntities())
     {
         var appUser = new AppUser
         {
             AppUserId = Guid.NewGuid(),
             FirstName = FirstName,
             LastName  = LastName,
             Age       = Age,
             Email     = Email,
             Password  = Password,
         };
         db.AppUser.Add(appUser);
         db.SaveChanges();
         return(true);
     }
 }