예제 #1
0
파일: SqlDef.cs 프로젝트: sdcb/sdmap
 public override Result <TurnOnResult> TurnOn(OneCallContext ctx)
 {
     Enabled   = true;
     _finalSql = Sql;
     return(Result.Ok(new TurnOnResult
     {
         Sql = _finalSql,
         HasMore = false
     }));
 }
예제 #2
0
파일: SqlDef.cs 프로젝트: sdcb/sdmap
        public override Result <TurnOnResult> TurnOn(OneCallContext ctx)
        {
            Enabled = true;
            int  currentCount = ctx.Deps.Count;
            var  result       = MacroUtil.EvalToString(Emiter, ctx, ctx.Obj);
            bool hasMore      = ctx.Deps.Count > currentCount;

            if (result.IsSuccess)
            {
                _finalSql = result.Value;
            }
            return(result.OnSuccess(s => new TurnOnResult
            {
                Sql = s,
                HasMore = hasMore
            }));
        }
예제 #3
0
 public string Emit(OneCallContext ctx)
 {
     return(TryEmit(ctx).Value);
 }
예제 #4
0
파일: SqlDef.cs 프로젝트: sdcb/sdmap
 public abstract Result <TurnOnResult> TurnOn(OneCallContext ctx);
예제 #5
0
 public Result <string> TryEmit(OneCallContext ctx)
 {
     return(EnsureCompiled(ctx.Compiler)
            .OnSuccess(() => Emiter(ctx))
            .Unwrap());
 }