public async Task <GenericResponse <PlayerLobbyGame> > SaveAsync(PlayerLobbyGame playerLobbyGame) { try{ await playerLobbyGameRepository.AddAsync(playerLobbyGame); await unityOfWork.CompleteAsync(); return(new GenericResponse <PlayerLobbyGame>(playerLobbyGame)); } catch (Exception ex) { return(new GenericResponse <PlayerLobbyGame>($"Error while saving playerLobbyGame. Message:{ex.Message}")); } }
public async Task <GenericResponse <PlayerLobbyGame> > DeleteAsync(PlayerLobbyGame playerLobbyGame) { var isExist = await playerLobbyGameRepository. FindByCompatibleKeyAsync(playerLobbyGame.PlayerId, playerLobbyGame.LobbyGameId); if (isExist == null) { return(new GenericResponse <PlayerLobbyGame>("PlayerLobbyGame doesn't exist!")); } try{ playerLobbyGameRepository.Delete(isExist); await unityOfWork.CompleteAsync(); return(new GenericResponse <PlayerLobbyGame>(isExist)); } catch (Exception ex) { return(new GenericResponse <PlayerLobbyGame>($"Error with deleting PlayerLobbyGame: {ex.Message}")); } }
public void Delete(PlayerLobbyGame playerLobbyGame) { context.PlayerLobbyGames.Remove(playerLobbyGame); }
public void Update(PlayerLobbyGame playerLobbyGame) { context.PlayerLobbyGames.Update(playerLobbyGame); }
public async Task AddAsync(PlayerLobbyGame playerLobbyGame) { await context.PlayerLobbyGames.AddAsync(playerLobbyGame); }