예제 #1
0
        internal AuditDetailMap()
        {
            var map = new CustomTypeMap <CustomerEntity>();

            map.Map("CustomerID", "Id");
            SqlMapper.SetTypeMap(map.Type, map);
        }
예제 #2
0
        private static string ResolveReferenceType(ApiObject obj)
        {
            if (obj == null)
            {
                return(null);
            }

            if (obj.Type != ApiObjectType.Object && obj.Type != ApiObjectType.Undefined)
            {
                return(CustomTypeMap.TryGetValue(obj.Name, out string remappedType) ?
                       remappedType :
                       ResolveDate(obj.Name, MapType(obj.Type), null));
            }

            return(obj.Name);
        }
예제 #3
0
        public static string ResolveType(ApiResponse response)
        {
            if (CustomTypeMap.TryGetValue(response.Name, out string remappedType))
            {
                return(remappedType);
            }

            if (response.Object.Type == ApiObjectType.Array)
            {
                return($"IEnumerable<{ResolveType(response.Object.Items) ?? "string"}>");
            }

            if (response.Object.Type != ApiObjectType.Object && response.Object.Type != ApiObjectType.Undefined)
            {
                return(MapType(response.Object.Type));
            }

            if (response.Object.Reference != null)
            {
                return(CustomTypeMap.TryGetValue(response.Object.Reference.Name, out string remappedType2) ? remappedType2 : response.Object.Reference.Name);
            }

            return(response.Object.Name);
        }