public async Task <bool> ExistsAsync(Guid id, Guid?userId = null) { if (userId == null) { return(await RepoDbSet.AnyAsync(a => a.Id == id)); } return(await RepoDbSet.AnyAsync(a => a.Id == id && a.Id == userId)); }
public async Task <bool> ExistsAsync(DateTime from, DateTime to, List <Guid> roomIds) { foreach (var id in roomIds) { if (!await RepoDbSet.AnyAsync(HasMatchingActiveDates(from, to, id))) { return(false); } } return(true); }
public async Task <bool> EmailExistsAsync(string email) { return(await RepoDbSet.AnyAsync(user => user.Email.ToLower().Equals(email.ToLower()))); }
public async Task <bool> NicknameExistsAsync(string userName) { return(await RepoDbSet.AnyAsync(user => userName.ToLower().Equals(user.UserNickname.ToLower()))); }
public async Task <bool> ExistsAsync(DAL.App.DTO.Availability availability) => await RepoDbSet.AnyAsync(HasMatchingActiveDates(availability.From, availability.To, availability.RoomId));
public async Task <bool> ActiveRoutineWithIdExistsForUserAsync(Guid routineId, Guid userId) { return(await RepoDbSet.AnyAsync(routine => routine.Id == routineId && routine.AppUserId == userId)); }
public async Task <bool> UserWithIdHasActiveRoutineAsync(Guid userId) { var doesUserHaveActiveRoutine = await RepoDbSet.AnyAsync(routine => routine.AppUserId.Equals(userId)); return(doesUserHaveActiveRoutine); }
public async Task <bool> BaseRoutineWithIdExistsAsync(Guid id) { return(await RepoDbSet.AnyAsync(w => w.AppUserId == null && w.Id.Equals(id))); }