slarny4/Demo1/Domain/UseCase/UserUseCase.cs

45 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-10-24 08:50:32 +00:00
using System;
using System.Collections.Generic;
2024-10-28 12:42:04 +00:00
using Demo.Data.LocalData.Entity; // Убедитесь, что это пространство имен присутствует
using Demo.Data.Repository;
using Demo.Domain.Models;
2024-10-21 22:57:01 +00:00
2024-10-28 12:42:04 +00:00
namespace Demo.Domain.UseCase
2024-10-21 22:57:01 +00:00
{
public class UserUseCase
{
2024-10-24 08:50:32 +00:00
private readonly IUserRepository _userRepository;
2024-10-21 22:57:01 +00:00
2024-10-24 08:50:32 +00:00
public UserUseCase(IUserRepository userRepository)
2024-10-21 22:57:01 +00:00
{
_userRepository = userRepository;
}
2024-10-28 12:42:04 +00:00
public IEnumerable<Domain.Models.User> GetAllUsers()
2024-10-24 08:50:32 +00:00
{
return _userRepository.GetAllUsers();
}
2024-10-28 12:42:04 +00:00
public void AddUser(Domain.Models.User user)
2024-10-24 08:50:32 +00:00
{
2024-10-28 12:42:04 +00:00
_userRepository.AddUser(user);
2024-10-24 08:50:32 +00:00
}
2024-10-28 12:42:04 +00:00
// Пример исправления
public Domain.Models.User GetUserById(Guid id)
2024-10-24 08:50:32 +00:00
{
2024-10-28 12:42:04 +00:00
return _userRepository.GetUserById(id);
2024-10-24 08:50:32 +00:00
}
2024-10-28 12:42:04 +00:00
internal void DeleteUser(Guid userId)
2024-10-24 08:50:32 +00:00
{
2024-10-28 12:42:04 +00:00
throw new NotImplementedException();
2024-10-24 08:50:32 +00:00
}
2024-10-28 12:42:04 +00:00
internal void UpdateUser(Models.User user)
2024-10-24 08:50:32 +00:00
{
2024-10-28 12:42:04 +00:00
throw new NotImplementedException();
2024-10-24 08:50:32 +00:00
}
2024-10-21 22:57:01 +00:00
}
2024-10-28 12:42:04 +00:00
}