//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); }
//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); }
//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); }
//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; }