First commit
This commit is contained in:
9
Logic/IUserService.cs
Normal file
9
Logic/IUserService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Models;
|
||||
|
||||
namespace Logic;
|
||||
|
||||
public interface IUserService
|
||||
{
|
||||
public void Create(string username, string email, string password);
|
||||
public User? Read();
|
||||
}
|
||||
13
Logic/Logic.csproj
Normal file
13
Logic/Logic.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../Repository/Repository.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
18
Logic/UserService.cs
Normal file
18
Logic/UserService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Models;
|
||||
using Repository;
|
||||
|
||||
namespace Logic;
|
||||
|
||||
public class UserService : IUserService
|
||||
{
|
||||
private IRepository repository;
|
||||
public User? Read()
|
||||
{
|
||||
return repository.Read();
|
||||
}
|
||||
|
||||
public void Create(string username, string email, string password)
|
||||
{
|
||||
repository.Write(new User(username, email, password));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user