Add a controler for "User" (add and authenticate)

This commit is contained in:
Sébastien André
2020-03-12 12:24:51 +01:00
parent 8a29fd7de9
commit 32a27b6d26
23 changed files with 225 additions and 34 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Data.Interface;
namespace skydiveLogs_api.Business
{
public class UserService : IUserService
{
public UserService(IUserRepository userRepository)
{
_userRepository = userRepository;
}
public User GetByLogin(string login, string password)
{
var tmp = _userRepository.GetByLogin(login, password);
return tmp;
}
public void AddNewUser(User newUser)
{
_userRepository.Add(newUser);
}
private readonly IUserRepository _userRepository;
}
}