示例#1
0
        public override WTableReference ToTableReference()
        {
            List <WScalarExpression> parameters = new List <WScalarExpression>();
            WTableReference          tableReference;

            if (PredicateContext != null)
            {
                parameters.Add(SqlUtil.GetScalarSubquery(PredicateContext.ToSelectQueryBlock()));
                parameters.Add(SqlUtil.GetScalarSubquery(TrueChoiceContext.ToSelectQueryBlock()));
                parameters.Add(SqlUtil.GetScalarSubquery(FalseChocieContext.ToSelectQueryBlock()));
                tableReference = SqlUtil.GetFunctionTableReference(GremlinKeyword.func.Choose, parameters, GetVariableName());
            }
            else
            {
                parameters.Add(SqlUtil.GetScalarSubquery(ChoiceContext.ToSelectQueryBlock()));
                foreach (var option in Options)
                {
                    if (option.Key is GremlinKeyword.Pick && (GremlinKeyword.Pick)option.Key == GremlinKeyword.Pick.None)
                    {
                        parameters.Add(SqlUtil.GetValueExpr(null));
                    }
                    else
                    {
                        parameters.Add(SqlUtil.GetValueExpr(option.Key));
                    }

                    parameters.Add(SqlUtil.GetScalarSubquery(option.Value.ToSelectQueryBlock()));
                }
                tableReference = SqlUtil.GetFunctionTableReference(GremlinKeyword.func.ChooseWithOptions, parameters, GetVariableName());
            }

            return(SqlUtil.GetCrossApplyTableReference(tableReference));
        }
示例#2
0
        internal override List <GremlinVariable> FetchAllTableVars()
        {
            List <GremlinVariable> variableList = new List <GremlinVariable>()
            {
                this
            };

            if (PredicateContext != null)
            {
                variableList.AddRange(PredicateContext.FetchAllTableVars());
                variableList.AddRange(TrueChoiceContext.FetchAllTableVars());
                variableList.AddRange(FalseChocieContext.FetchAllTableVars());
            }
            else
            {
                variableList.AddRange(ChoiceContext.FetchAllTableVars());
                foreach (var option in Options)
                {
                    variableList.AddRange(option.Value.FetchAllTableVars());
                }
            }
            return(variableList);
        }
示例#3
0
 public StudentsController(ChoiceContext context, UserManager <ApplicationUser> userManager, IGroupService groupService)
 {
     _groupService = groupService;
     _userManager  = userManager;
     _context      = context;
 }
示例#4
0
 public TeachersController(ChoiceContext context)
 {
     _context = context;
 }
示例#5
0
 public DisciplinesController(ChoiceContext context)
 {
     _context = context;
 }
示例#6
0
 public IndexModel(ChoiceContext db)
 {
     _db = db;
 }
示例#7
0
 public TeachersController(ChoiceContext context, UserManager <ApplicationUser> userManager)
 {
     _userManager = userManager;
     _context     = context;
 }
示例#8
0
 public HomeController(ILogger <HomeController> logger, ChoiceContext context)
 {
     _logger  = logger;
     _context = context;
 }