public void Build(ISqExtensionBuilder builder) { var part = builder.GetValue <DateParts>(0); var startdate = builder.GetExpression(1); var endDate = builder.GetExpression(2); var partSql = new SqlExpression(DatePartBuilder.DatePartToStr(part), Precedence.Primary); builder.ResultExpression = new SqlFunction(typeof(int), builder.Expression, partSql, startdate, endDate); }
public void Build(ISqExtensionBuilder builder) { var part = builder.GetValue <Sql.DateParts>("part"); var partStr = DatePartBuilder.DatePartToStr(part); var date = builder.GetExpression("date"); var number = builder.GetExpression("number"); builder.ResultExpression = new SqlFunction(typeof(DateTimeOffset?), builder.Expression, new SqlExpression(partStr, Precedence.Primary), number, date); }