Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IdEntity&lt;TId&gt;"/> class
 /// copied from the specified <paramref name="entity"/>.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <exception cref="ArgumentNullException"><paramref name="entity"/> is null.</exception>
 protected IdEntity(IdEntity <TId> entity) : base(entity)
 {
     _id = entity._id;
 }
Exemple #2
0
 /// <summary>
 /// Indicates whether the current entity <see cref="Id"/> is equal to another entity <see cref="Id"/>.
 /// </summary>
 /// <param name="other">An entity to compare with this entity.</param>
 /// <returns><c>true</c> if the current entity <see cref="Id"/> is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.</returns>
 public bool Equals(IdEntity <TId> other)
 {
     return(ReferenceEquals(this, other) ||
            (other != null &&
             object.Equals(Id, other.Id)));
 }