<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MassTransit;
using Microsoft.Xrm.Sdk;
using Xrm.Oss.Interfacing.Domain;
using Xrm.Oss.Interfacing.Domain.Implementations;

namespace Xrm.Oss.CrmPublisher
{
    public class CrmPublisher : MarshalByRefObject, ICrmPublisher
    {
        public void ProcessMessage(IMessage message, IOrganizationService service, IBusControl busControl)
        {
            var record = service.Retrieve(message.Scenario.Entity, message.RecordId.Value, new Microsoft.Xrm.Sdk.Query.ColumnSet(true));

            busControl.Publish(new CrmMessage
            {
                Scenario = message.Scenario,
                RecordId = message.RecordId,
                Attributes = record.Attributes.Where(pair => pair.Value != null).ToDictionary(pair => pair.Key, pair => pair.Value)
            });
        }

        public List<IScenario> RetrieveSupportedScenarios()
        {
            return new List<IScenario>
            {
                new Scenario("update", "account"),
                new Scenario("create", "account")
            };
        }
    }
}
<commit_msg>Update CrmPublisher.cs<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MassTransit;
using Microsoft.Xrm.Sdk;
using Xrm.Oss.Interfacing.Domain;
using Xrm.Oss.Interfacing.Domain.Implementations;

namespace Xrm.Oss.CrmPublisher
{
    public class CrmPublisher : MarshalByRefObject, ICrmPublisher
    {
        public void ProcessMessage(IMessage message, IOrganizationService service, IBusControl busControl)
        {
            var record = service.Retrieve(message.Scenario.Entity, message.RecordId.Value, new Microsoft.Xrm.Sdk.Query.ColumnSet(true));

            busControl.Publish(new CrmMessage
            {
                Scenario = message.Scenario,
                RecordId = message.RecordId,
                Attributes = record.Attributes.Where(pair => pair.Value != null).ToDictionary(pair => pair.Key, pair => pair.Value)
            });
        }

        public List<IScenario> RetrieveSupportedScenarios()
        {
            return new List<IScenario>
            {
                new Scenario("update", "account"),
                new Scenario("create", "account"),
                new Scenario("update", "contact"),
                new Scenario("create", "contact")
            };
        }
    }
}

{'fraction_non_alphanumeric': 0.10003985651654046, 'fraction_numerical': 0.0, 'mean_word_length': 2.4149659863945576, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3428860', 'n_tokens_mistral': 712, 'n_tokens_neox': 681, 'n_words': 135}