Skip to content

Commit 65621a0

Browse files
Implemented future DELETE method interface
1 parent 45a3bf6 commit 65621a0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Commander/domain/CommanderRepository.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public void CreateCommand(Command cmd)
1414
throw new NotImplementedException();
1515
}
1616

17+
public void DeleteCommand(Command cmd)
18+
{
19+
throw new NotImplementedException();
20+
}
21+
1722
public IEnumerable<Command> GetAllCommands()
1823
{
1924
var commands = new List<Command>

Commander/domain/SqlCommanderRepository.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public void CreateCommand(Command cmd)
2525
context.Commands.Add(cmd);
2626
}
2727

28+
public void DeleteCommand(Command cmd)
29+
{
30+
if (cmd == null)
31+
{
32+
throw new ArgumentNullException(nameof(cmd));
33+
}
34+
35+
context.Commands.Remove(cmd);
36+
}
37+
2838
public IEnumerable<Command> GetAllCommands()
2939
{
3040
return context.Commands.ToList();

0 commit comments

Comments
 (0)