private AttributeMetadata InvokeDataTypeHandler(ConfigurationFile.AttributeDataTypes dataType, object[] dataRowValues) { var handler = (from method in GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance) let attributes = method.GetCustomAttributes(typeof(DataTypeHandlerAttribute), true).Where(x => ((DataTypeHandlerAttribute)x).DataType == dataType) where attributes != null && attributes.Count() > 0 select new { Method = method, Attributes = attributes.Cast <DataTypeHandlerAttribute>() }) .First(); return((AttributeMetadata)handler.Method.Invoke(this, new object[] { dataRowValues })); }
public DataTypeHandlerAttribute(ConfigurationFile.AttributeDataTypes dataType) { DataType = dataType; }