示例#1
0
 public String GetNameForRequestField(
     SdkMessageRequest request, SdkMessageRequestField requestField,
     IServiceProvider services)
 {
     return(DefaultNamingService.GetNameForRequestField(
                request, requestField, services));
 }
示例#2
0
        public override string GetNameForRequestField(SdkMessageRequest request, SdkMessageRequestField requestField, IServiceProvider services)
        {
            string returnValue  = string.Empty;
            string defaultValue = base.GetNameForRequestField(request, requestField, services);

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

                returnValue = namer.GetNameForRequestField(request, requestField, services);
            }

            if (string.IsNullOrEmpty(returnValue))
            {
                returnValue = defaultValue;
            }

            var cacheItem = DynamicsMetadataCache.SdkMessagePairs.GetOrParse(request.MessagePair);

            if (cacheItem != null)
            {
                cacheItem.GeneratedRequestTypeName = returnValue;
            }

            DynamicsMetadataCache.SdkMessagePairs.Set(cacheItem);

            return(string.IsNullOrEmpty(returnValue) ? defaultValue : returnValue);
        }
示例#3
0
        /// <inheritdoc />
        public string GetNameForRequestField(SdkMessageRequest request, SdkMessageRequestField requestField, IServiceProvider services)
        {
            string value = _defaultService.GetNameForRequestField(request, requestField, services);

            value = ModifyPublisher(value);
            return(value);
        }
示例#4
0
        public string GetNameForRequestField(SdkMessageRequest request, SdkMessageRequestField requestField, IServiceProvider services)
        {
            var defaultName = DefaultService.GetNameForRequestField(request, requestField, services);

            return(CamelCaseMemberNames
                ? CamelCaser.Case(defaultName)
                : defaultName);
        }
 public MetadataRequest(SdkMessageRequest request)
 {
     Id            = request.Id;
     Name          = request.Name;
     RequestFields = new Dictionary <int, MetadataRequestField>();
     foreach (var field in request.RequestFields)
     {
         RequestFields[field.Key] = new MetadataRequestField(field.Value);
     }
 }
        public SdkMessageRequest ToSdk(SdkMessagePair sdk)
        {
            var request = new SdkMessageRequest(sdk, Id, Name);

            foreach (var field in RequestFields)
            {
                request.RequestFields[field.Key] = field.Value.ToSdk(request);
            }

            return(request);
        }
示例#7
0
        async Task <string> INamingService.GetNameForRequestFieldAsync(SdkMessageRequest request,
                                                                       SdkMessageRequestField requestField, IServiceProvider services)
        {
            await CrmSvcUtil.CrmSvcUtilLogger.TraceMethodStartAsync("Entering {0}", MethodBase.GetCurrentMethod().Name);

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

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

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

            return(text);
        }
示例#8
0
 public CodeGenerationType GetTypeForRequestField(SdkMessageRequest request, SdkMessageRequestField requestField,
                                                  IServiceProvider services)
 {
     return(DefaultService.GetTypeForRequestField(request, requestField, services));
 }
示例#9
0
 protected virtual CodeGenerationType GetTypeForRequestFieldInternal(SdkMessageRequest request, SdkMessageRequestField requestField, IServiceProvider services)
 {
     return(DefaultService.GetTypeForRequestField(request, requestField, services));
 }
示例#10
0
 /// <inheritdoc />
 public string GetNameForRequestField(SdkMessageRequest request, SdkMessageRequestField requestField, IServiceProvider services)
 {
     return(NamingServiceImplementation.GetNameForRequestField(request, requestField, services));
 }
示例#11
0
 internal SdkMessageRequestField ToSdk(SdkMessageRequest sdk)
 {
     return(new SdkMessageRequestField(sdk, Index, Name, CLRFormatter, IsOptional));
 }
示例#12
0
 public string GetNameForRequestField(SdkMessageRequest request, Microsoft.Crm.Services.Utility.SdkMessageRequestField requestField, IServiceProvider services)
 {
     return(DefaultNamingService.GetNameForRequestField(request, requestField, services));
 }