Beispiel #1
0
        public string GetCountExpression(string schemaObject, uint fieldNumber)
        {
            switch (category)
            {
            case ValueType.Primitive:
                return
                    ($"{schemaObject}.{SchemaFunctionMappings.GetCountSchemaFunctionFromType(primitiveType.Value)}({fieldNumber})");

            case ValueType.Enum:
                return($"{schemaObject}.GetEnumCount({fieldNumber})");

            case ValueType.Type:
                return($"{schemaObject}.GetObjectCount({fieldNumber})");

            default:
                throw new ArgumentOutOfRangeException("Unknown type category encountered.");
            }
        }
Beispiel #2
0
        public string GetCountExpression(string schemaObject, int fieldNumber)
        {
            switch (category)
            {
            case ContainedTypeCategory.Primitive:
                return
                    ($"{schemaObject}.{SchemaFunctionMappings.GetCountSchemaFunctionFromType(rawType)}({fieldNumber})");

            case ContainedTypeCategory.Enum:
                return($"{schemaObject}.GetEnumCount({fieldNumber})");

            case ContainedTypeCategory.UserDefined:
                return($"{schemaObject}.GetObjectCount({fieldNumber})");

            default:
                throw new ArgumentOutOfRangeException("Unknown type category encountered.");
            }
        }