using Govor.Application.Interfaces; using Govor.Core.Models; using Govor.Core.Repositories.Groups; using Govor.Data.Repositories.Exceptions; namespace Govor.Application.Services; public class UserGroupsService : IUserGroupsService { private readonly IGroupsRepository _groupRep; public UserGroupsService(IGroupsRepository groupsRepository) { _groupRep = groupsRepository; } public async Task> GetUserGroupsAsync(Guid userId) { try { return await _groupRep.GetByUserIdAsync(userId); } catch (NotFoundByKeyException ex) { return new List(); } } }