# Publish and Handle an Event Event messages need to either implement `IEvent` or match a custom `DefiningEventsAs` convention. See the [message design documentation](/nservicebus/messaging/messages-events-commands.md) for more details. ## Handling an event In order to handle an event, implement the `IHandleMessages` interface in any [handler](/nservicebus/handlers/index.md) or [saga](/nservicebus/sagas/index.md) class, where `T` is the specific event type. ## Publishing an event Call the `Publish` method to publish an event. There are a few common scenarios for publishing events. Events might be published: - from a **handler**, when processing another message. ```cs public class CreateUserHandler : IHandleMessages { public async Task Handle(CreateUserCommand message, IMessageHandlerContext context) { var userCreatedEvent = new UserCreatedEvent { Name = message.Name }; await context.Publish(userCreatedEvent); } } ``` - from a **saga handler**, when processing another message. ```cs public class CreateUserSaga : Saga, IHandleMessages { public async Task Handle(CreateUserCommand message, IMessageHandlerContext context) { var userCreatedEvent = new UserCreatedEvent { Name = message.Name }; await context.Publish(userCreatedEvent); } ``` - at endpoint startup ```cs // Other config var endpointInstance = await Endpoint.Start(endpointConfiguration); await endpointInstance.Publish(new MyEvent()); ``` ## Composing events In order to support advanced composition scenarios, events can be defined as interfaces. See the [Messages as Interfaces](/nservicebus/messaging/messages-as-interfaces.md) for more details.