44using System ;
55using AppCore . Diagnostics ;
66
7- namespace AppCore . Data
7+ namespace AppCore . Data ;
8+
9+ /// <summary>
10+ /// Exception which is thrown when a entity was not found.
11+ /// </summary>
12+ public class EntityNotFoundException : EntityException
813{
914 /// <summary>
10- /// Exception which is thrown when a entity was not found.
15+ /// Gets the <see cref="Type"/> of the entity which was not found.
1116 /// </summary>
12- public class EntityNotFoundException : EntityException
13- {
14- /// <summary>
15- /// Gets the <see cref="Type"/> of the entity which was not found.
16- /// </summary>
17- public Type EntityType { get ; }
17+ public Type EntityType { get ; }
1818
19- /// <summary>
20- /// Gets the unique id of the entity which was not found.
21- /// </summary>
22- public object Id { get ; }
19+ /// <summary>
20+ /// Gets the unique id of the entity which was not found.
21+ /// </summary>
22+ public object Id { get ; }
2323
24- /// <summary>
25- /// Initializes a new instance of the <see cref="EntityNotFoundException"/> class.
26- /// </summary>
27- /// <param name="entityType">The <see cref="Type"/> of the entity.</param>
28- /// <param name="id">The id of the entity.</param>
29- public EntityNotFoundException ( Type entityType , object id )
30- : base ( $ "Entity '{ entityType . GetDisplayName ( ) } ' with id '{ id } ' was not found.")
31- {
32- Ensure . Arg . NotNull ( entityType , nameof ( entityType ) ) ;
33- Ensure . Arg . NotNull ( id , nameof ( id ) ) ;
24+ /// <summary>
25+ /// Initializes a new instance of the <see cref="EntityNotFoundException"/> class.
26+ /// </summary>
27+ /// <param name="entityType">The <see cref="Type"/> of the entity.</param>
28+ /// <param name="id">The id of the entity.</param>
29+ public EntityNotFoundException ( Type entityType , object id )
30+ : base ( $ "Entity '{ entityType . GetDisplayName ( ) } ' with id '{ id } ' was not found.")
31+ {
32+ Ensure . Arg . NotNull ( entityType ) ;
33+ Ensure . Arg . NotNull ( id ) ;
3434
35- EntityType = entityType ;
36- Id = id ;
37- }
35+ EntityType = entityType ;
36+ Id = id ;
3837 }
3938}
0 commit comments