mirror of https://github.com/abpframework/abp.git
3 changed files with 43 additions and 4 deletions
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
using System.Reflection; |
||||
|
|
||||
|
namespace Volo.Abp.EventBus.Dapr; |
||||
|
|
||||
|
public class AbpDaprEventData<TData> |
||||
|
{ |
||||
|
public TData Data { get; set; } |
||||
|
|
||||
|
public string CorrelationId { get; set; } |
||||
|
|
||||
|
public AbpDaprEventData(TData data, string correlationId) |
||||
|
{ |
||||
|
Data = data; |
||||
|
CorrelationId = correlationId; |
||||
|
} |
||||
|
|
||||
|
public static object Create(object data, string correlationId) |
||||
|
{ |
||||
|
return Activator.CreateInstance( |
||||
|
typeof(AbpDaprEventData<>).MakeGenericType(data.GetType()), |
||||
|
BindingFlags.Instance | BindingFlags.Public, |
||||
|
binder: null, |
||||
|
new object[] { data, correlationId }, |
||||
|
culture: null)!; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue