EntityEventData.cs 896 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using Abp.Domain.Entities;
  3. namespace Abp.Events.Bus.Entities
  4. {
  5. /// <summary>
  6. /// Used to pass data for an event that is related to with an <see cref="IEntity"/> object.
  7. /// </summary>
  8. /// <typeparam name="TEntity">Entity type</typeparam>
  9. [Serializable]
  10. public class EntityEventData<TEntity> : EventData , IEventDataWithInheritableGenericArgument
  11. {
  12. /// <summary>
  13. /// Related entity with this event.
  14. /// </summary>
  15. public TEntity Entity { get; private set; }
  16. /// <summary>
  17. /// Constructor.
  18. /// </summary>
  19. /// <param name="entity">Related entity with this event</param>
  20. public EntityEventData(TEntity entity)
  21. {
  22. Entity = entity;
  23. }
  24. public virtual object[] GetConstructorArgs()
  25. {
  26. return new object[] { Entity };
  27. }
  28. }
  29. }