vgquotes/Src/VideoGameQuotes.Api/Persistence/UserService.cs
tmont 9a1f0347c0 * tests for user provider
* username is no longer required
* added ip address property to user
2011-02-10 21:04:13 +00:00

34 lines
755 B
C#

using System;
using Portoa.Persistence;
namespace VideoGameQuotes.Api.Persistence {
public interface IUserService {
User Save(User user);
User FindByUsername(string name);
User FindByIpAddress(string ipAddress);
}
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);
}
[UnitOfWork]
public User FindByIpAddress(string ipAddress) {
return repository.FindByIpAddress(ipAddress);
}
}
}