/// <summary> /// Uses information in the dto to send notifications. /// </summary> /// <param name="dto">Dto containing notification information.</param> /// <returns>Task that returns the command result.</returns> public async Task <CommandResultNoDto> SendNotification(NotificationDto dto) { var validationResult = _validator.Validate(dto); if (validationResult.IsInvalid) { return(new CommandResultNoDto(validationResult)); } if (dto.BroadcastAll) { await _notificationSender.SendAll(dto.Message); } else { await _notificationSender.SendGroup(dto.GroupName, dto.Message); } return(new CommandResultNoDto(FacadeStatusCode.Ok)); }