public static string UnsupportedSourceTypeForAggregateFunction(AggregateFunctionContext context) { StringBuilder error = GetIntro(context.Member); error.AppendFormat("Aggregate function '{0}' doesn't support type '{1}' as source type", context.ImplementationType, context.Member.Type); return(error.ToString()); }
public override IEnumerable <CodeStatement> GetInitializationStatements(AggregateFunctionContext context) { List <CodeStatement> statements = new List <CodeStatement>(base.GetInitializationStatements(context)); CodeStatement st = new CodeVariableDeclarationStatement(typeof(int), GetCounterObjectName(context), new CodeSnippetExpression("0")); statements.Add(st); return(statements); }
protected override string GetFormatForExecutedExpression(AggregateFunctionContext context) { // todo: test return(string.Format("FN_OBJ = FN_OBJ + CURR_ITEM; {0}++;", GetCounterObjectName(context))); }
private static string GetCounterObjectName(AggregateFunctionContext context) { return(context.FunctionObjectName + "_Cnt"); }