private e.Team CreateEntityFromTeam(Team t) { if (t == null) { return(null); } e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin); return(result); }
public Team UpdateTeam(Team team) { e.Team toUpdate = (from t in _m.Team where t.Id == team.Id select t).First(); toUpdate.Members = team.Members; toUpdate.Name = team.Name; toUpdate.Password = team.Password; toUpdate.IsAdmin = team.IsAdmin; toUpdate.Score = team.Score; _m.SaveChanges(); _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toUpdate); return(team); }
public Team SaveTeam(Team team) { e.Team toSave = new e.Team() { IsAdmin = team.IsAdmin, Members = team.Members, Name = team.Name, Password = team.Password, Score = team.Score, CreateDate = DateTime.Now }; _m.AddToTeam(toSave); _m.SaveChanges(); team.Id = toSave.Id; return(team); }
private Team CreateTeamFromEntity(e.Team eTeam) { if (eTeam == null) { return(null); } Team result = new Team() { Id = eTeam.Id, CreateDate = eTeam.CreateDate, IsAdmin = eTeam.IsAdmin, Name = eTeam.Name, Members = eTeam.Members, Password = eTeam.Password, Score = eTeam.Score }; return(result); }
public Team SaveTeam(Team team) { e.Team toSave = new e.Team() { IsAdmin = team.IsAdmin, Members = team.Members, Name = team.Name, Password = team.Password, Score = team.Score, CreateDate = DateTime.Now }; _m.AddToTeam(toSave); _m.SaveChanges(); // _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toSave); team.Id = toSave.Id; return(team); }
private e.Team CreateEntityFromTeam(Team t) { if (t == null) { return(null); } e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin); //e.Team result = new e.Team() //{ // Id = t.Id, // CreateDate = t.CreateDate, // IsAdmin = t.IsAdmin, // Members = t.Members, // Name = t.Name, // Password = t.Password, // Score = t.Score //}; return(result); }
private Team CreateTeamFromEntity(e.Team eTeam) { if (eTeam == null) { return null; } Team result = new Team() { Id = eTeam.Id, CreateDate = eTeam.CreateDate, IsAdmin = eTeam.IsAdmin, Name = eTeam.Name, Members = eTeam.Members, Password = eTeam.Password, Score = eTeam.Score }; return result; }
private e.Team CreateEntityFromTeam(Team t) { if (t == null) { return null; } e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin); //e.Team result = new e.Team() //{ // Id = t.Id, // CreateDate = t.CreateDate, // IsAdmin = t.IsAdmin, // Members = t.Members, // Name = t.Name, // Password = t.Password, // Score = t.Score //}; return result; }
public Team UpdateTeam(Team team) { e.Team toUpdate = (from t in _m.Team where t.Id == team.Id select t).First(); toUpdate.Members = team.Members; toUpdate.Name = team.Name; toUpdate.Password = team.Password; toUpdate.IsAdmin = team.IsAdmin; toUpdate.Score = team.Score; _m.SaveChanges(); _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toUpdate); return team; }
public Team SaveTeam(Team team) { e.Team toSave = new e.Team() { IsAdmin = team.IsAdmin, Members = team.Members, Name = team.Name, Password = team.Password, Score = team.Score, CreateDate = DateTime.Now }; _m.AddToTeam(toSave); _m.SaveChanges(); // _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toSave); team.Id = toSave.Id; return team; }
private e.Team CreateEntityFromTeam(Team t) { if (t == null) { return null; } e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin); return result; }
public Team SaveTeam(Team team) { e.Team toSave = new e.Team() { IsAdmin = team.IsAdmin, Members = team.Members, Name = team.Name, Password = team.Password, Score = team.Score, CreateDate = DateTime.Now }; _m.AddToTeam(toSave); _m.SaveChanges(); team.Id = toSave.Id; return team; }