Example #1
0
 private static IEnumerable <GeneratedStorageProperty> BuildStorageProperties(SObjectDescription objDescription, ConnectedServiceLogger logger)
 {
     return(objDescription.Fields
            .Select(f => CodeModelBuilder.BuildStorageProperty(
                        f,
                        (soapType) => logger.WriteMessageAsync(LoggerMessageCategory.Error, Resources.LogMessage_UnsupportedSoapType, soapType, objDescription.Name, f.Name)))
            .ToArray());
 }
Example #2
0
        private static GeneratedStorageProperty BuildStorageProperty(SObjectField field, Action <string> onUnsupportedType)
        {
            Type clrType = CodeModelBuilder.GetClrType(field.SoapType, onUnsupportedType);

            return(new GeneratedStorageProperty()
            {
                ClrType = clrType,
                IsNullableType = field.Nillable && clrType.IsValueType,
                IsKey = field.Type == "id" && !field.Nillable,
                Model = field
            });
        }
Example #3
0
        public static async Task <IEnumerable <GeneratedObject> > BuildObjectModelAsync(
            IEnumerable <SObjectDescription> sObjects,
            DesignTimeAuthentication authentication,
            GeneratedService generatedService,
            ConnectedServiceLogger logger)
        {
            IEnumerable <SObjectDescription> sObjectsWithDetails = await MetadataLoader.LoadObjectDetailsAsync(sObjects, authentication);

            IEnumerable <GeneratedObject> generatedObjects = sObjectsWithDetails
                                                             .Select(o => new GeneratedObject()
            {
                Model             = o,
                Service           = generatedService,
                StorageProperties = CodeModelBuilder.BuildStorageProperties(o, logger)
            })
                                                             .ToArray();

            return(generatedObjects);
        }