public override void when(IEvents myevent) { string abc = myevent.GetType().Name; switch (abc) { case "CustomerCreatedEvent": { var cust = myevent as CustomerCreatedEvent; CustomerId = cust.CustomerId; firstName = cust.FirstName; lastName = cust.LastName; break; } } }
public bool CanHandle(IEvents events) => events.GetType().Equals(typeof(CustomerCreatedEvent));