internal TypeMappingService(CrmSvcUtilParameters parameters) { _namespace = parameters.Namespace; _attributeTypeMapping = new Dictionary<AttributeTypeCode, Type> { {AttributeTypeCode.Boolean, typeof (bool)}, {AttributeTypeCode.ManagedProperty, typeof (BooleanManagedProperty)}, {AttributeTypeCode.CalendarRules, typeof (object)}, {AttributeTypeCode.Customer, typeof (EntityReference)}, {AttributeTypeCode.DateTime, typeof (DateTime)}, {AttributeTypeCode.Decimal, typeof (decimal)}, {AttributeTypeCode.Double, typeof (double)}, {AttributeTypeCode.Integer, typeof (int)}, {AttributeTypeCode.EntityName, typeof (string)}, {AttributeTypeCode.BigInt, typeof (long)}, {AttributeTypeCode.Lookup, typeof (EntityReference)}, {AttributeTypeCode.Memo, typeof (string)}, {AttributeTypeCode.Money, typeof (Money)}, {AttributeTypeCode.Owner, typeof (EntityReference)}, {AttributeTypeCode.Picklist, typeof (OptionSetValue)}, {AttributeTypeCode.Status, typeof (OptionSetValue)}, {AttributeTypeCode.String, typeof (string)}, {AttributeTypeCode.Uniqueidentifier, typeof (Guid)} }; }
internal void InitializeServices(CrmSvcUtilParameters parameters) { var defaultServiceInstance = new CodeWriterFilterService(parameters); _services.Add(typeof (ICodeWriterFilterService), ServiceFactory.CreateInstance<ICodeWriterFilterService>(defaultServiceInstance, parameters.CodeWriterFilterService, parameters)); _services.Add(typeof (ICodeWriterMessageFilterService), ServiceFactory.CreateInstance<ICodeWriterMessageFilterService>(defaultServiceInstance, parameters.CodeWriterMessageFilterService, parameters)); _services.Add(typeof (IMetadataProviderService), ServiceFactory.CreateInstance<IMetadataProviderService>(new SdkMetadataProviderService(parameters), parameters.MetadataProviderService, parameters)); _services.Add(typeof (ICodeGenerationService), ServiceFactory.CreateInstance<ICodeGenerationService>(new CodeGenerationService(), parameters.CodeGenerationService, parameters)); _services.Add(typeof (INamingService), ServiceFactory.CreateInstance<INamingService>(new NamingService(parameters), parameters.NamingService, parameters)); _services.Add(typeof (ICustomizeCodeDomService), ServiceFactory.CreateInstance<ICustomizeCodeDomService>(new CodeDomCustomizationService(), parameters.CodeCustomizationService, parameters)); _services.Add(typeof (ITypeMappingService), new TypeMappingService(parameters)); }
internal NamingService(CrmSvcUtilParameters parameters) { if (!string.IsNullOrWhiteSpace(parameters.ServiceContextName)) { _serviceContextName = parameters.ServiceContextName; } else { _serviceContextName = typeof (OrganizationServiceContext).Name + "1"; } _nameMap = new Dictionary<string, int>(); _knowNames = new Dictionary<string, string>(); _reservedAttributeNames = new List<string>(); foreach (var info in typeof (Entity).GetProperties()) { _reservedAttributeNames.Add(info.Name); } }
internal SdkMetadataProviderService(CrmSvcUtilParameters parameters) { _parameters = parameters; }
CrmSvcUtil() { MethodTracer.Enter(); _parameters = new CrmSvcUtilParameters(); MethodTracer.Exit(); }
internal CodeWriterFilterService(CrmSvcUtilParameters parameters) { _messageNamespace = parameters.MessageNamespace; _generateMessages = parameters.GenerateMessages; _generateServiceContext = !string.IsNullOrWhiteSpace(parameters.ServiceContextName); }