private static string GetDataContainerName(Type type) { var attribute = ReflectionTools.GetCustomAttribute(type, "System.Runtime.Serialization.DataContractAttribute"); string?attributeName = null; if (attribute != null) { attributeName = (string?)attribute.GetType().TryInstanceProperty("Name")?.GetValue(attribute); } return(string.IsNullOrWhiteSpace(attributeName) ? ReflectionTools.GetNonGenericName(type) : attributeName !); }
private static Attribute?GetOperationContractAttribute(MethodInfo method) { return(ReflectionTools.GetCustomAttribute(method, "System.ServiceModel.OperationContractAttribute")); }
private static Attribute?GetServiceContractAttribute(Type type) { return(ReflectionTools.GetCustomAttribute(type, "System.ServiceModel.ServiceContractAttribute")); }