27 lines
573 B
C#
27 lines
573 B
C#
|
using Portoa.Persistence;
|
|||
|
|
|||
|
namespace VideoGameQuotes.Api.Persistence {
|
|||
|
|
|||
|
public interface IUserService {
|
|||
|
User Save(User user);
|
|||
|
User FindByUsername(string name);
|
|||
|
}
|
|||
|
|
|||
|
public class UserService : IUserService {
|
|||
|
private readonly IUserRepository repository;
|
|||
|
|
|||
|
public UserService(IUserRepository repository) {
|
|||
|
this.repository = repository;
|
|||
|
}
|
|||
|
|
|||
|
[UnitOfWork]
|
|||
|
public User Save(User user) {
|
|||
|
return repository.Save(user);
|
|||
|
}
|
|||
|
|
|||
|
[UnitOfWork]
|
|||
|
public User FindByUsername(string name) {
|
|||
|
return repository.FindByUsername(name);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|