Esempio n. 1
0
        public static async Task LeaveGameSession(this GetOnBoardDbContext source, GameSessionApplicationUser gSAppUser, GameSession gameSession)
        {
            source.GameSessionApplicationUsers.Remove(gSAppUser);
            await source.SaveChangesAsync();

            await source.UpdateFreeSlotsInGS(gameSession, -1);
        }
Esempio n. 2
0
        public static async Task <int> AddGameSession(this GetOnBoardDbContext source, GameSession gameSession)
        {
            source.GameSessions.Add(gameSession);
            await source.SaveChangesAsync();

            return(gameSession.ID);
        }
Esempio n. 3
0
 public AuthenticationController(GetOnBoardDbContext dbContext,
                                 UserManager <ApplicationUser> userManager,
                                 IConfiguration configuration,
                                 ILogger <AuthenticationController> logger)
 {
     _dbContext     = dbContext;
     _userManager   = userManager;
     _configuration = configuration;
     _logger        = logger;
 }
Esempio n. 4
0
 public static async Task UpdateDataInUserProfile(this GetOnBoardDbContext source, UserProfile userProfile, UpdateProfileViewModel model, string boardGameImage)
 {
     userProfile.FirstName   = model.FirstName;
     userProfile.LastName    = model.LastName;
     userProfile.City        = model.City;
     userProfile.Description = model.Description;
     userProfile.Avatar      = boardGameImage;
     source.UserProfiles.Update(userProfile);
     await source.SaveChangesAsync();
 }
Esempio n. 5
0
 public static async Task UpdateNumberGamesSessionDeletedasAdmin(this GetOnBoardDbContext source, UserProfile userProfile)
 {
     userProfile.NumberOfGamesSessionDeletedasAdmin = userProfile.NumberOfGamesSessionDeletedasAdmin + 1;
     await source.SaveChangesAsync();
 }
Esempio n. 6
0
 public static async Task UpdateFreeSlotsInGS(this GetOnBoardDbContext source, GameSession gameSession, int count)
 {
     gameSession.SlotsFree = gameSession.SlotsFree + count;
     source.GameSessions.Update(gameSession);
     await source.SaveChangesAsync();
 }
Esempio n. 7
0
 public static async Task RemoveGameSessionAsync(this GetOnBoardDbContext source, GameSession gameSession)
 {
     gameSession.IsCanceled = true;
     source.GameSessions.Update(gameSession);
     await source.SaveChangesAsync();
 }
 public ProfileRepository(ILogger <ProfileRepository> logger, GetOnBoardDbContext db, IBlobStorageRepository blobStorage)
 {
     _logger      = logger;
     _db          = db;
     _blobStorage = blobStorage;
 }
 public ChatRepository(ILogger <ChatRepository> logger, GetOnBoardDbContext db)
 {
     _logger = logger;
     _db     = db;
 }
Esempio n. 10
0
        public static async Task AddMessageFromUser(this GetOnBoardDbContext source, Contact contact)
        {
            source.Contact.Add(contact);

            await source.SaveChangesAsync();
        }
Esempio n. 11
0
 public ContactController(GetOnBoardDbContext db, ILogger <GameSessionsController> logger)
 {
     _db     = db;
     _logger = logger;
 }
Esempio n. 12
0
 public ProfileController(GetOnBoardDbContext db, ILogger <ProfileController> logger, IProfileRepository repository)
 {
     _db                = db;
     _logger            = logger;
     _profileRepository = repository;
 }
 public ChatHub(IChatRepository chat, GetOnBoardDbContext db)
 {
     _chat = chat;
     _db   = db;
 }
Esempio n. 14
0
 public ImageController(GetOnBoardDbContext dbContext, ILogger <ImageController> logger, IBlobStorageRepository blobStorage)
 {
     _dbContext   = dbContext;
     _logger      = logger;
     _blobStorage = blobStorage;
 }
 public GameSessionsRepository(ILogger <GameSessionsRepository> logger, GetOnBoardDbContext db, IBlobStorageRepository blobStorage)
 {
     _logger      = logger;
     _db          = db;
     _blobStorage = blobStorage;
 }
Esempio n. 16
0
 public static async Task UpdateNumberGamesJoined(this GetOnBoardDbContext source, UserProfile userProfile)
 {
     userProfile.NumberOfGamesSessionJoined = userProfile.NumberOfGamesSessionJoined + 1;
     await source.SaveChangesAsync();
 }
Esempio n. 17
0
 public static async Task UpdateNumberOfGamesSessionYouWereKickedOut(this GetOnBoardDbContext source, UserProfile userProfile)
 {
     userProfile.NumberOfGamesSessionYouWereKickedOut = userProfile.NumberOfGamesSessionYouWereKickedOut + 1;
     await source.SaveChangesAsync();
 }
Esempio n. 18
0
 public static async Task AddBoardGameToGameSession(this GetOnBoardDbContext source, GameSessionBoardGame gameSessionBG)
 {
     source.GameSessionBoardGames.Add(gameSessionBG);
     await source.SaveChangesAsync();
 }
Esempio n. 19
0
 public GameSessionsController(GetOnBoardDbContext db, ILogger <GameSessionsController> logger, IGameSessionsRepository repository)
 {
     _db     = db;
     _logger = logger;
     _gameSessionRepository = repository;
 }
Esempio n. 20
0
 public static async Task AddBoardGame(this GetOnBoardDbContext source, BoardGame boardGame)
 {
     source.BoardGames.Add(boardGame);
     await source.SaveChangesAsync();
 }
 public static async Task RemoveGameSessionBoardGamesAsync(this GetOnBoardDbContext source, GameSessionBoardGame gameSessionBG)
 {
     source.GameSessionBoardGames.Remove(gameSessionBG);
     await source.SaveChangesAsync();
 }
 public static async Task RemoveGameSessionApplicationUserAsync(this GetOnBoardDbContext source, GameSessionApplicationUser gameSessionAppUser)
 {
     source.GameSessionApplicationUsers.Remove(gameSessionAppUser);
     await source.SaveChangesAsync();
 }