public void ContainsFragment_ContainsStronglyTypedSqlFragmentParameter_True()
        {
            TypeNode stringTypeNode = IntrospectionUtility.TypeNodeFactory <string>();
            Method   sample         = TestHelper.GetSample <FragmentUtilitySample>("ContainsStronglyTypedSqlFragmentParameter", stringTypeNode);
            bool     isResult       = FragmentUtility.ContainsFragment(sample.Parameters[0].Attributes);

            Assert.That(isResult, Is.True);
        }
Ejemplo n.º 2
0
        private void AnalyzeFields()
        {
            IEnumerable <Field> fields = IntrospectionUtility.FilterFields(_method.DeclaringType);

            foreach (Field field in fields)
            {
                if (field.Attributes != null && FragmentUtility.ContainsFragment(field.Attributes))
                {
                    _result.MakeUnsafe(field.Name.Name);
                }
            }
        }
Ejemplo n.º 3
0
        private void PassReturnFragmentTypeToContext(Expression operand, Parameter parameter)
        {
            string   symbol       = IntrospectionUtility.GetVariableName(operand);
            Fragment fragmentType = FragmentUtility.GetFragmentType(parameter.Attributes);

            if (FragmentUtility.ContainsFragment(parameter.Attributes))
            {
                _symbolTable.MakeSafe(symbol, fragmentType);
            }
            else
            {
                _symbolTable.MakeUnsafe(symbol);
            }
        }
Ejemplo n.º 4
0
 private void SetSymbolFragmentType(string name, AttributeNodeCollection attributes)
 {
     if (!_result.Contains(name))
     {
         if (FragmentUtility.ContainsFragment(attributes))
         {
             Fragment fragmentType = FragmentUtility.GetFragmentType(attributes);
             _result.MakeSafe(name, fragmentType);
         }
         else
         {
             _result.MakeUnsafe(name);
         }
     }
 }