<commit_before><%
if (CurrentUnit.GenerationParams.GenerateAsynchronous)
{
    foreach (UnitOfWorkCriteriaManager.UoWCriteria uowCrit in listUoWCriteriaCreator)
    {
        string strNewParams = string.Empty;
        string strNewCritParams = string.Empty;
        string strNewComment = string.Empty;
        int elementCriteriaCount = 0;
        int parameterCount = 0;
        foreach (UnitOfWorkCriteriaManager.ElementCriteria c in uowCrit.ElementCriteriaList)
        {
            if (string.IsNullOrEmpty(c.Name))
                continue;

            if (!string.IsNullOrEmpty(c.Parameter))
            {
                if (elementCriteriaCount > 0)
                    strNewCritParams += ", ";
                strNewCritParams += c.Parameter;
                elementCriteriaCount++;
                elementCriteriaCount++;
                continue;
            }

            if (elementCriteriaCount > 0)
                strNewCritParams += ", ";
            if (parameterCount > 0)
                strNewParams += ", ";
            strNewParams += string.Concat(FormatCamel(c.Name), " As ", c.Type);
            strNewCritParams += FormatCamel(c.Name);
            strNewComment += "''' <param name=\"" + FormatCamel(c.Name) + "\">The " + FormatProperty(c.Name) + " of the " + Info.ObjectName + " to create.</param>" + System.Environment.NewLine + new string(' ', 8);
            elementCriteriaCount++;
            parameterCount++;
        }
        strNewParams += (strNewParams.Length > 0 ? ", " : "") + "callback As EventHandler(Of DataPortalResult(Of " + Info.ObjectName + "))";
        string strNewCache = string.Empty;
        foreach (UnitOfWorkProperty prop in Info.UnitOfWorkProperties)
        {
            CslaObjectInfo objectInfo = Info.Parent.CslaObjects.Find(prop.TypeName);
            if (objectInfo.SimpleCacheOptions != SimpleCacheResults.None)
            {
                strGetCache += "                If Not " + prop.TypeName + ".IsCached Then" + Environment.NewLine;
                strGetCache += "                    " + prop.TypeName + ".SetCache(e.Object." + prop.TypeName + ")" + Environment.NewLine;
                strGetCache += "                End If" + Environment.NewLine;
            }
        }
        if (Info.UnitOfWorkType == UnitOfWorkFunction.CreatorGetter && elementCriteriaCount == 0)
        {
            strNewCritParams = "True, ";
        }
        %>

        ''' <summary><commit_msg>Fix VB UnitOfWork Work Item #1716<commit_after><%
if (CurrentUnit.GenerationParams.GenerateAsynchronous)
{
    foreach (UnitOfWorkCriteriaManager.UoWCriteria uowCrit in listUoWCriteriaCreator)
    {
        string strNewParams = string.Empty;
        string strNewCritParams = string.Empty;
        string strNewComment = string.Empty;
        int elementCriteriaCount = 0;
        int parameterCount = 0;
        foreach (UnitOfWorkCriteriaManager.ElementCriteria c in uowCrit.ElementCriteriaList)
        {
            if (string.IsNullOrEmpty(c.Name))
                continue;

            if (!string.IsNullOrEmpty(c.Parameter))
            {
                if (elementCriteriaCount > 0)
                    strNewCritParams += ", ";
                strNewCritParams += c.Parameter;
                elementCriteriaCount++;
                elementCriteriaCount++;
                continue;
            }

            if (elementCriteriaCount > 0)
                strNewCritParams += ", ";
            if (parameterCount > 0)
                strNewParams += ", ";
            strNewParams += string.Concat(FormatCamel(c.Name), " As ", c.Type);
            strNewCritParams += FormatCamel(c.Name);
            strNewComment += "''' <param name=\"" + FormatCamel(c.Name) + "\">The " + FormatProperty(c.Name) + " of the " + Info.ObjectName + " to create.</param>" + System.Environment.NewLine + new string(' ', 8);
            elementCriteriaCount++;
            parameterCount++;
        }
        strNewParams += (strNewParams.Length > 0 ? ", " : "") + "callback As EventHandler(Of DataPortalResult(Of " + Info.ObjectName + "))";
        string strNewCache = string.Empty;
        foreach (UnitOfWorkProperty prop in Info.UnitOfWorkProperties)
        {
            CslaObjectInfo objectInfo = Info.Parent.CslaObjects.Find(prop.TypeName);
            if (objectInfo.SimpleCacheOptions != SimpleCacheResults.None)
            {
                strNewCache += "                If Not " + prop.TypeName + ".IsCached Then" + Environment.NewLine;
                strNewCache += "                    " + prop.TypeName + ".SetCache(e.Object." + prop.TypeName + ")" + Environment.NewLine;
                strNewCache += "                End If" + Environment.NewLine;
            }
        }
        if (Info.UnitOfWorkType == UnitOfWorkFunction.CreatorGetter && elementCriteriaCount == 0)
        {
            strNewCritParams = "True, ";
        }
        %>

        ''' <summary>
{'fraction_non_alphanumeric': 0.11198865937626569, 'fraction_numerical': 0.004050222762251924, 'mean_word_length': 1.9052941176470588, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '4891954', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1284, 'n_words': 242}