/// <summary> /// Retrieve a list of datatypedefinitions which share the same IDataType datatype /// </summary> /// <param name="DataTypeId">The unique id of the IDataType</param> /// <returns>A list of datatypedefinitions which are based on the IDataType specified</returns> public static DataTypeDefinition GetByDataTypeId(Guid DataTypeId) { int dfId = 0; foreach (DataTypeDefinition df in DataTypeDefinition.GetAll()) { if (df.DataType.Id == DataTypeId) { dfId = df.Id; break; } } if (dfId == 0) { return(null); } else { return(new DataTypeDefinition(dfId)); } }
/// <summary> /// Retrieve a list of datatypedefinitions which share the same IDataType datatype /// </summary> /// <param name="DataTypeId">The unique id of the IDataType</param> /// <returns>A list of datatypedefinitions which are based on the IDataType specified</returns> public static DataTypeDefinition GetByDataTypeId(Guid DataTypeId) { int dfId = 0; // When creating a datatype and not saving it, it will be null, so we need this check foreach (DataTypeDefinition df in DataTypeDefinition.GetAll().Where(x => x.DataType != null)) { if (df.DataType.Id == DataTypeId) { dfId = df.Id; break; } } if (dfId == 0) { return(null); } else { return(new DataTypeDefinition(dfId)); } }