public static void DeleteIntention(long id) { Intention intention = intentionRepository.GetById(id); if (intention != null) { intentionRepository.Delete(intention); } }
public Task Handle(RemoveIntentionCommand notification, CancellationToken cancellationToken) { notification.FillEntities(); if (notification.Invalid) { NotifyValidationErrors(notification); return(Task.CompletedTask); } intentionRepository.Delete(notification.IntenttionId); if (Commit()) { return(Task.CompletedTask); } else { Bus.RaiseEvent(new DomainNotification(notification.MessageType, "Não foi possivel remover intenção de compra.")); return(Task.CompletedTask); } }