private static void SaveMessage(MessageEntity message, DeliveryReportEntity deliveryReport) { using (var dataBinding = new MessageDataAccessor()) { message = dataBinding.SetMessage(message); if (deliveryReport != null && message != null) { deliveryReport.MessageId = message.MessageId; dataBinding.InsertDeliveryReport(deliveryReport); } } }