コード例 #1
0
        //CK: Function to create FhirTypeInfo instead of putting this knowledge in the FhirTypeInfo constructor,
        //because I don't want to pass an IFhirModel to all instances of FhirTypeInfo and FhirPropertyInfo.
        private static FhirTypeInfo CreateFhirTypeInfo(Type fhirType)
        {
            if (fhirType == null)
            {
                return(null);
            }

            var result = new FhirTypeInfo {
                FhirType = fhirType, TypeName = fhirType.Name
            };
            var attFhirType = fhirType.GetCustomAttribute <FhirTypeAttribute>(false);

            if (attFhirType != null)
            {
                result.TypeName = attFhirType.Name;
            }

            return(result);
        }
コード例 #2
0
        //CK: Function to create FhirTypeInfo instead of putting this knowledge in the FhirTypeInfo constructor,
        //because I don't want to pass an IFhirModel to all instances of FhirTypeInfo and FhirPropertyInfo.
        internal FhirTypeInfo CreateFhirTypeInfo(Type fhirType)
        {
            if (fhirType == null)
            {
                return(null);
            }

            var result = new FhirTypeInfo();

            result.FhirType = fhirType;

            result.TypeName = fhirType.Name;
            var attFhirType = fhirType.GetCustomAttribute <FhirTypeAttribute>(false);

            if (attFhirType != null)
            {
                result.TypeName = attFhirType.Name;
            }

            return(result);
        }
コード例 #3
0
        //CK: Function to create FhirTypeInfo instead of putting this knowledge in the FhirTypeInfo constructor,
        //because I don't want to pass an IFhirModel to all instances of FhirTypeInfo and FhirPropertyInfo.
        internal FhirTypeInfo CreateFhirTypeInfo(Type fhirType)
        {
            if (fhirType == null)
            {
                return(null);
            }

            var result = new FhirTypeInfo();

            result.FhirType = fhirType;

            result.TypeName = fhirType.Name;
            var attFhirType = fhirType.GetCustomAttribute <FhirTypeAttribute>(false);

            if (attFhirType != null)
            {
                result.TypeName = attFhirType.Name;
            }

            result.properties = fhirType.GetProperties().Select(p => CreateFhirPropertyInfo(p)).ToList();

            return(result);
        }
コード例 #4
0
ファイル: FhirPropertyIndex.cs プロジェクト: Condeti/spark
        //CK: Function to create FhirTypeInfo instead of putting this knowledge in the FhirTypeInfo constructor, 
        //because I don't want to pass an IFhirModel to all instances of FhirTypeInfo and FhirPropertyInfo.
        internal FhirTypeInfo CreateFhirTypeInfo(Type fhirType)
        {
            if (fhirType == null)
                return null;

            var result = new FhirTypeInfo();

            result.FhirType = fhirType;

            result.TypeName = fhirType.Name;
            var attFhirType = fhirType.GetCustomAttribute<FhirTypeAttribute>(false);
            if (attFhirType != null)
            {
                result.TypeName = attFhirType.Name;
            }

            result.properties = fhirType.GetProperties().Select(p => CreateFhirPropertyInfo(p)).ToList();

            return result;
        }