* Added EdiUser Entity and DTO

* Added LoginService to handle login and user creation
* Extended DbContext
* Extended Mapper
This commit is contained in:
2025-01-31 10:08:53 +01:00
parent 3f78a5ecc5
commit 9a7920f0e7
6 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public interface ILoginService
{
Task<EdiUserDto> CreateUser(string userName, string password);
Task<bool> Login(string username, string password);
}

View File

@@ -0,0 +1,26 @@
using AutoMapper;
using SytelineSaAppEfDataModel.Entities;
namespace SytelineSaAppEfDataModel.Services;
public class LoginService(SytelineSaAppDbContext context, IMapper mapper) : ILoginService
{
public async EdiUserd CreateUser(string userName, string password)
{
EdiUser user = new EdiUser()
{
Login = userName,
Password = password,
};
context.EdiUsers.Add(user);
await context.SaveChangesAsync();
return
}
public bool Login(string userName, string password)
{
}
}