CRUD implemented
This commit is contained in:
@@ -6,9 +6,8 @@ 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);
|
||||
void Delete(uint ID);
|
||||
void Delete(PasswordStore item);
|
||||
void Create(PasswordStore item);
|
||||
void Edit(uint ID, PasswordStore newItem);
|
||||
}
|
||||
|
||||
@@ -7,38 +7,33 @@ public class PasswordStoreService : IPasswordStoreService
|
||||
{
|
||||
private readonly IRepository repository;
|
||||
|
||||
public int Create(string path, string? displayName = null, string? iconName = null)
|
||||
public void Create(PasswordStore item)
|
||||
{
|
||||
Create(item);
|
||||
}
|
||||
|
||||
public void Delete(uint ID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int Create(PasswordStore item)
|
||||
public void Delete(PasswordStore item)
|
||||
{
|
||||
return Create(item.Path, item.DisplayName, item.IconName);
|
||||
Delete(item.ID);
|
||||
}
|
||||
|
||||
public int Delete(uint ID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int Delete(PasswordStore item)
|
||||
{
|
||||
return Delete(item.ID);
|
||||
}
|
||||
|
||||
public int Edit(uint ID, PasswordStore newItem)
|
||||
public void Edit(uint ID, PasswordStore newItem)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public PasswordStore Get(uint ID)
|
||||
{
|
||||
return repository.ReadAll().Where(item => item.ID.Equals(ID)).First();
|
||||
return repository.Get(ID);
|
||||
}
|
||||
|
||||
public IEnumerable<PasswordStore> GetAll()
|
||||
{
|
||||
return (IEnumerable<PasswordStore>)repository.ReadAll();
|
||||
return (IEnumerable<PasswordStore>)repository.GetAll();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user