public Session Add(DTO.Session session) { Player domainPlayer = RepositoryProxy.Instance.PlayerRepository.Get(session.Characters.First().Player); Session domainSession = new Session() { Name = session.Name, }; _db.Set <Session>().Add(domainSession); _db.SaveChanges(); Character domainCharacter = new Character() { Name = session.Characters.First().Name, Health = 20, Player = domainPlayer, Session = domainSession }; _db.Set <Character>().Add(domainCharacter); _db.SaveChanges(); return(Get(domainSession.SessionID)); }
public Character Add(DTO.Character character) { Character domainCharacter = CharacterConverter.DTOToDomain(character); _db.Characters.Add(domainCharacter); _db.SaveChanges(); return(domainCharacter); }
public Log Add(DTO.Log log) { Log domainLog = LogConverter.DTOToDomain(log); _db.Logs.Add(domainLog); _db.SaveChanges(); return(Get(domainLog.LogID)); }
public Player Add(DTO.Player player) { Player domainPlayer = new Player() { Name = player.Name }; _db.Players.Add(domainPlayer); _db.SaveChanges(); return(domainPlayer); }