Exemplo n.º 1
0
 private static void CheckParameter(FunctionParameter paramMeta, string varName)
 {
     ArgumentValidation.CheckReadOnly((GlobalItem)paramMeta.DeclaringFunction, varName);
     if (!ArgumentValidation.CheckDataSpace(paramMeta.TypeUsage))
     {
         throw new ArgumentException(Strings.Cqt_Metadata_FunctionParameterIncorrectSpace, varName);
     }
 }
Exemplo n.º 2
0
 internal static void CheckMember(EdmMember memberMeta, string varName)
 {
     ArgumentValidation.CheckReadOnly((GlobalItem)memberMeta.DeclaringType, varName);
     if (!ArgumentValidation.CheckDataSpace(memberMeta.TypeUsage) || !ArgumentValidation.CheckDataSpace((GlobalItem)memberMeta.DeclaringType))
     {
         throw new ArgumentException(Strings.Cqt_Metadata_EdmMemberIncorrectSpace, varName);
     }
 }
Exemplo n.º 3
0
 internal static void CheckType(TypeUsage type, string varName)
 {
     ArgumentValidation.CheckReadOnly(type, varName);
     if (!ArgumentValidation.CheckDataSpace(type))
     {
         throw new ArgumentException(Strings.Cqt_Metadata_TypeUsageIncorrectSpace, nameof(type));
     }
 }
Exemplo n.º 4
0
 internal static void CheckEntitySet(EntitySetBase entitySet, string varName)
 {
     ArgumentValidation.CheckReadOnly(entitySet, varName);
     if (entitySet.EntityContainer == null)
     {
         throw new ArgumentException(Strings.Cqt_Metadata_EntitySetEntityContainerNull, varName);
     }
     if (!ArgumentValidation.CheckDataSpace((GlobalItem)entitySet.EntityContainer))
     {
         throw new ArgumentException(Strings.Cqt_Metadata_EntitySetIncorrectSpace, varName);
     }
     if (!ArgumentValidation.CheckDataSpace((GlobalItem)entitySet.ElementType))
     {
         throw new ArgumentException(Strings.Cqt_Metadata_EntitySetIncorrectSpace, varName);
     }
 }
Exemplo n.º 5
0
        private static void CheckFunction(EdmFunction function)
        {
            ArgumentValidation.CheckReadOnly((GlobalItem)function, nameof(function));
            if (!ArgumentValidation.CheckDataSpace((GlobalItem)function))
            {
                throw new ArgumentException(Strings.Cqt_Metadata_FunctionIncorrectSpace, nameof(function));
            }
            if (function.IsComposableAttribute && function.ReturnParameter == null)
            {
                throw new ArgumentException(Strings.Cqt_Metadata_FunctionReturnParameterNull, nameof(function));
            }
            if (function.ReturnParameter != null && !ArgumentValidation.CheckDataSpace(function.ReturnParameter.TypeUsage))
            {
                throw new ArgumentException(Strings.Cqt_Metadata_FunctionParameterIncorrectSpace, "function.ReturnParameter");
            }
            IList <FunctionParameter> parameters = (IList <FunctionParameter>)function.Parameters;

            for (int index = 0; index < parameters.Count; ++index)
            {
                ArgumentValidation.CheckParameter(parameters[index], StringUtil.FormatIndex("function.Parameters", index));
            }
        }
Exemplo n.º 6
0
 private static void CheckType(EdmType type, string argumentName)
 {
     ArgumentValidation.CheckReadOnly((GlobalItem)type, argumentName);
 }