Exemple #1
0
 public String GetNameForResponseField(
     SdkMessageResponse response, SdkMessageResponseField responseField,
     IServiceProvider services)
 {
     return(DefaultNamingService.GetNameForResponseField(
                response, responseField, services));
 }
 public MetadataResponseField(SdkMessageResponseField field)
 {
     Index        = field.Index;
     Name         = field.Name;
     CLRFormatter = field.CLRFormatter;
     Value        = field.Value;
 }
Exemple #3
0
        /// <inheritdoc />
        public string GetNameForResponseField(SdkMessageResponse response, SdkMessageResponseField responseField, IServiceProvider services)
        {
            string value = _defaultService.GetNameForResponseField(response, responseField, services);

            value = ModifyPublisher(value);
            return(value);
        }
Exemple #4
0
        public string GetNameForResponseField(SdkMessageResponse response, SdkMessageResponseField responseField, IServiceProvider services)
        {
            var defaultName = DefaultService.GetNameForResponseField(response, responseField, services);

            return(CamelCaseMemberNames
                ? CamelCaser.Case(defaultName)
                : defaultName);
        }
Exemple #5
0
        async Task <string> INamingService.GetNameForResponseFieldAsync(SdkMessageResponse response,
                                                                        SdkMessageResponseField responseField, IServiceProvider services)
        {
            await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStartAsync("Entering {0}", MethodBase.GetCurrentMethod().Name);

            if (this._knowNames.ContainsKey(response.Id.ToString() + responseField.Index.ToString(CultureInfo.InvariantCulture)))
            {
                await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStopAsync("Exiting {0}", MethodBase.GetCurrentMethod().Name);

                return(this._knowNames[response.Id.ToString() + responseField.Index.ToString(CultureInfo.InvariantCulture)]);
            }
            var text = NamingService.CreateValidName(responseField.Name);

            this._knowNames.Add(response.Id.ToString() + responseField.Index.ToString(CultureInfo.InvariantCulture), text);
            await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStopAsync("Exiting {0}", MethodBase.GetCurrentMethod().Name);

            return(text);
        }
Exemple #6
0
        public override string GetNameForResponseField(SdkMessageResponse response, SdkMessageResponseField responseField, IServiceProvider services)
        {
            string returnValue  = string.Empty;
            string defaultValue = base.GetNameForResponseField(response, responseField, services);

            foreach (var namer in _namers)
            {
                Trace.Debug($"Executing naming rule {nameof(GetNameForResponseField)} using {namer.GetType().FullName}");

                returnValue = namer.GetNameForResponseField(response, responseField, services);

                if (returnValue != defaultValue)
                {
                    break;
                }
            }

            return(string.IsNullOrEmpty(returnValue) ? defaultValue : returnValue);
        }
Exemple #7
0
 public CodeGenerationType GetTypeForResponseField(SdkMessageResponse response, SdkMessageResponseField responseField,
                                                   IServiceProvider services)
 {
     return(DefaultService.GetTypeForResponseField(response, responseField, services));
 }
Exemple #8
0
 protected virtual CodeGenerationType GetTypeForResponseFieldInternal(SdkMessageResponse response, SdkMessageResponseField responseField, IServiceProvider services)
 {
     return(DefaultService.GetTypeForResponseField(response, responseField, services));
 }
 /// <inheritdoc />
 public string GetNameForResponseField(SdkMessageResponse response, SdkMessageResponseField responseField, IServiceProvider services)
 {
     return(NamingServiceImplementation.GetNameForResponseField(response, responseField, services));
 }
Exemple #10
0
        async Task <CodeTypeReference> ITypeMappingService.GetTypeForResponseFieldAsync(SdkMessageResponseField responseField,
                                                                                        IServiceProvider services)
        {
            await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStartAsync("Entering {0}", MethodBase.GetCurrentMethod().Name);

            await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStopAsync("Exiting {0}", MethodBase.GetCurrentMethod().Name);

            return(this.GetTypeForField(responseField.CLRFormatter, false));
        }