Started implementing backend
This commit is contained in:
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