public async Task <int> AddUserSportListsAsync(string userId, int sportListId) { UserSportLists userList = new UserSportLists(); userList.UserSecret = userId; userList.FKSportListId = sportListId; int succes = 0; try { await _sportDatabaseContext.UserSportLists.AddAsync(userList); succes = _sportDatabaseContext.SaveChanges(); return(succes); } catch (Exception e) { Console.WriteLine(e.Message); } return(succes); }
public async Task <UserSportLists> UserSportList(string userId) { UserSportLists userSportList = await _sportDatabaseContext.UserSportLists.Include(x => x.SportList).Where(x => x.UserSecret == userId).FirstOrDefaultAsync(); return(userSportList); }
public async Task <UserSportLists> UserSportListsById(int Id) { UserSportLists getUserSportLists = await _userSportListsRepository.Get(p => p.Id == Id); return(getUserSportLists); }
public async Task <int> EditUserSportListsAsync(UserSportLists userSportLists) { return(await _userSportListsRepository.Edit(userSportLists)); }
public async Task <int> DeleteUserSportListsAsync(UserSportLists userSportLists) { return(await _userSportListsRepository.Delete(userSportLists)); }
public async Task <int> AddUserSportListsAsync(UserSportLists userSportLists) { return(await _userSportListsRepository.Add(userSportLists)); }