Started implementing backend
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace Logic;
|
||||
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
14
Logic/IPasswordStoreService.cs
Normal file
14
Logic/IPasswordStoreService.cs
Normal 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);
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
44
Logic/PasswordStoreService.cs
Normal file
44
Logic/PasswordStoreService.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user