Exemplo n.º 1
0
        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 !);
        }
Exemplo n.º 2
0
 private static Attribute?GetOperationContractAttribute(MethodInfo method)
 {
     return(ReflectionTools.GetCustomAttribute(method, "System.ServiceModel.OperationContractAttribute"));
 }
Exemplo n.º 3
0
 private static Attribute?GetServiceContractAttribute(Type type)
 {
     return(ReflectionTools.GetCustomAttribute(type, "System.ServiceModel.ServiceContractAttribute"));
 }