33 lines
865 B
C#
33 lines
865 B
C#
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,
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|
|
|
|
}
|
|
} |