1.判断类被某个属性应用blog
private bool CheckForServiceContractAttribute(Type type) { return type.IsDefined(typeof(ServiceContractAttribute), false); }