public async Task <InterestItem> AddInterest(string Category, string Tag) { return(await FirebaseDbConnection.AddInterest(new InterestItem() { Category = Category, Name = Tag })); }
public void UpdateUserAccessList() { logger.Log(LogLevel.Information, "Downloading User Access List..."); var _userAccessListm = FirebaseDbConnection.GetUsers(); _userAccessListm.Wait(); _userAccessList = _userAccessListm.Result; }
public new async Task Remove(InterestItem item) { base.Remove(item); if (string.IsNullOrEmpty(item.Key)) { return; } await FirebaseDbConnection.RemoveInterest(item); }
public async Task <bool> UpdateUser(User user) { try { await FirebaseDbConnection.UpdateUser(user); return(true); } catch { return(false); } }
public async Task <bool> RegisterUser(User user) { logger.Log(LogLevel.Information, "Registering user: " + user.ToString()); if (_userAccessList.FirstOrDefault(e => e.Username.Contains(user.Username, StringComparison.InvariantCultureIgnoreCase)) == null) { var result = await FirebaseDbConnection.CreateUser(user); result.Object.Key = result.Key; _userAccessList.Add(result.Object); return(true); } return(false); }
public async Task <InterestItem> Add(string Category, string Tag) { if (string.IsNullOrEmpty(Category) || string.IsNullOrEmpty(Tag)) { return(null); } var interest = new InterestItem() { Category = Category, Name = Tag }; try { interest.Key = (await FirebaseDbConnection.AddInterest(interest)).Key; Add(interest); } catch (Exception e) { logger.LogError("Failed adding interest error message: {0}", e.Message); } return(interest); }
private void GetInterestList() { logger.Log(LogLevel.Information, "Downloading Interest List..."); Clear(); AddRange(FirebaseDbConnection.GetInterests().Result); }
public void Delete(Lobby lobby) { Task.Run(() => FirebaseDbConnection.removeRoom(lobby)); Lobbies.Remove(lobby); }
// Active rooms save to Firebase public void Add(Lobby lobby) { Task.Run(() => FirebaseDbConnection.addRoom(lobby)); }
public async Task RemoveInterest(InterestItem item) { await FirebaseDbConnection.RemoveInterest(item); Interests.Remove(item); }