Skip to content

Commit

Permalink
fixed #7, generic parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwittke committed Sep 19, 2017
1 parent bf3cf4c commit 1c165a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Backend.Fx/Exceptions/NotFoundException.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
namespace Backend.Fx.Exceptions
{
public class NotFoundException<TAggregateRoot> : NotFoundException
public class NotFoundException<TEntity> : NotFoundException
{
public NotFoundException(int id) : base(typeof(TAggregateRoot).Name, id)
public NotFoundException(int id) : base(typeof(TEntity).Name, id)
{}
}

public abstract class NotFoundException : ClientException
{

public string AggregateName { get; }
public string EntityName { get; }

public int Id { get; }

protected NotFoundException(string aggregateName, int id) : base($"No {aggregateName} with id {id} found.")
protected NotFoundException(string entityName, int id) : base($"No {entityName} with id {id} found.")
{
AggregateName = aggregateName;
EntityName = entityName;
Id = id;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Backend.Fx.Tests/Exceptions/TheNotFOundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class TheNotFoundException
public void FillsNameAndIdProperties()
{
var exception = new NotFoundException<TheAggregateRoot.TestAggregateRoot>(4711);
Assert.Equal("TestAggregateRoot", exception.AggregateName);
Assert.Equal("TestAggregateRoot", exception.EntityName);
Assert.Equal(4711, exception.Id);
}
}
Expand Down

0 comments on commit 1c165a9

Please sign in to comment.