Started implementing backend

This commit is contained in:
TypoMustakes
2025-09-22 13:08:08 +02:00
parent 5bd03270d4
commit ebfd763e68
14 changed files with 173 additions and 14 deletions

View File

@@ -1,6 +0,0 @@
namespace Logic;
public class Class1
{
}

View File

@@ -0,0 +1,14 @@
using Models;
namespace Logic;
public interface IPasswordStoreService
{
IEnumerable<PasswordStore> GetAll();
PasswordStore Get(uint ID);
int Delete(uint ID);
int Delete(PasswordStore item);
int Create(string path, string? displayName = null, string? iconName = null);
int Create(PasswordStore item);
int Edit(uint ID, PasswordStore newItem);
}

View File

@@ -1,9 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Models/Models.csproj" />
<ProjectReference Include="../Repository/Repository.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,44 @@
using Models;
using Repository;
namespace Logic;
public class PasswordStoreService : IPasswordStoreService
{
private readonly IRepository repository;
public int Create(string path, string? displayName = null, string? iconName = null)
{
throw new NotImplementedException();
}
public int Create(PasswordStore item)
{
return Create(item.Path, item.DisplayName, item.IconName);
}
public int Delete(uint ID)
{
throw new NotImplementedException();
}
public int Delete(PasswordStore item)
{
return Delete(item.ID);
}
public int Edit(uint ID, PasswordStore newItem)
{
throw new NotImplementedException();
}
public PasswordStore Get(uint ID)
{
return repository.ReadAll().Where(item => item.ID.Equals(ID)).First();
}
public IEnumerable<PasswordStore> GetAll()
{
return (IEnumerable<PasswordStore>)repository.ReadAll();
}
}