presence_new/not relevant/UserService.cs

33 lines
865 B
C#
Raw Permalink Normal View History

2024-12-17 09:13:12 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using domain.Models.ResponseModels;
using domain.UseCase;
using presence.data.Repository;
namespace domain.Services
{
public class UserService : IUserUseCase
{
private readonly IUserRepository _userRepository;
public IEnumerable<UserResponse> GetStudents()
{
return _userRepository.GetAllUser().Select(
user => new UserResponse
{
Id = user.UserId,
FIO = user.FIO,
GroupId = user.GroupId,
Group = new GroupResponse
{
Name = user.Group.Name,
Id = user.Group.Id,
}
}
);
}
}
}