/// <summary> /// Initializes a new instance of the <see cref="PersistEntity"/> 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 PersistEntity(PersistEntity entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } _persistChange = entity._persistChange; }
/// <summary> /// Initializes a new instance of the <see cref="EntityItem<TEntity>"/> class /// with the specified <see cref="PersistChange"/>. /// </summary> /// <param name="entity">The entity.</param> /// <param name="persistChange">The persist change.</param> /// <exception cref="ArgumentNullException"><paramref name="entity"/> is null.</exception> public EntityItem(TEntity entity, PersistChange persistChange) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } _entity = entity; _persistEntity = entity as PersistEntity; if (_persistEntity != null) { _persistEntity.PropertyChanged += new PropertyChangedEventHandler(Entity_PropertyChanged); } _persistChange = persistChange; }
/// <summary> /// Initializes a new instance of the <see cref="IdEntity"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> protected IdEntity(PersistChange persistChange) : base(persistChange) { Id = Guid.NewGuid(); }
/// <summary> /// Initializes a new instance of the <see cref="UpdateAuditEntity"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> public UpdateAuditEntity(PersistChange persistChange) : base(persistChange) { Id = Guid.NewGuid(); CreatedOn = DateTimeOffset.UtcNow; }
/// <summary> /// Initializes a new instance of the <see cref="CreateAuditEntity<TId,TCreatedBy,TCreatedOn>"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> public CreateAuditEntity(PersistChange persistChange) : base(persistChange) { }
/// <summary> /// Initializes a new instance of the <see cref="IdEntity<TId>"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> protected IdEntity(PersistChange persistChange) : base(persistChange) { }
/// <summary> /// Initializes a new instance of the <see cref="PersistEntity"/> class /// with the specified <see cref="PersistChange"/>. /// </summary> /// <param name="persistChange">The persist change.</param> protected PersistEntity(PersistChange persistChange) { _persistChange = persistChange; }
/// <summary> /// Initializes a new instance of the <see cref="AuditEntity<TId,TAuditedBy,TAuditedOn>"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> protected AuditEntity(PersistChange persistChange) : base(persistChange) { }
/// <summary> /// Initializes a new instance of the <see cref="AuditEntity"/> class /// with the specified <see cref="PersistChange"/> /// </summary> /// <param name="persistChange">The persist change.</param> public AuditEntity(PersistChange persistChange) : base(persistChange) { Id = Guid.NewGuid(); }