//private static void checkMutualExclusiveAttributes(Type type) //{ // if (ClassMapping.IsFhirResource(type) && ClassMapping.IsFhirComplexType(type)) // throw Error.Argument("type", "Type {0} cannot be both a Resource and a Complex datatype", type); // if (ClassMapping.IsFhirResource(type) && ClassMapping.IsFhirPrimitive(type)) // throw Error.Argument("type", "Type {0} cannot be both a Resource and a Primitive datatype", type); // if (ClassMapping.IsFhirComplexType(type) && ClassMapping.IsFhirPrimitive(type)) // throw Error.Argument("type", "Type {0} cannot be both a Complex and a Primitive datatype", type); //} //private static object invokeEnumParser(string input, Type enumType) //{ // object result = null; // bool success = EnumHelper.TryParseEnum(input, enumType, out result); // if (!success) // throw Error.InvalidOperation("Parsing of enum failed"); // return result; //} private static string getProfile(Type type) { var attr = ReflectionHelper.GetAttribute <FhirTypeAttribute>(type); return(attr != null ? attr.Profile : null); }
public static bool IsMappableEnum(Type t) { return(t.IsEnum() && ReflectionHelper.GetAttribute <FhirEnumerationAttribute>(t) != null); }