lmplement all actions
This commit is contained in:
@@ -17,6 +17,23 @@ namespace GerbilManager.Repositories
|
||||
}
|
||||
|
||||
public Gerbil GetGerbil(Guid id) => _gerbilList.SingleOrDefault(x => x.Id == id);
|
||||
|
||||
public void CreateGerbil(Gerbil gerbil)
|
||||
{
|
||||
_gerbilList.Add(gerbil);
|
||||
}
|
||||
|
||||
public void UpdateGerbil(Gerbil gerbil)
|
||||
{
|
||||
var index = this._gerbilList.FindIndex(existingGerbil => existingGerbil.Id == gerbil.Id);
|
||||
_gerbilList[index] = gerbil;
|
||||
}
|
||||
|
||||
public void DeleteGerbil(Gerbil gerbil)
|
||||
{
|
||||
var index = this._gerbilList.FindIndex(existingGerbil => existingGerbil.Id == gerbil.Id);
|
||||
_gerbilList.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user