Пример #1
0
        public string Get(string url)
        {
            var sql = new CreatorSql();

            return(sql.request("select " +
                               "CONCAT( " +
                               "CONCAT( " +
                               " '{\"title\":\"', m.title, '\"', " +
                               " ',\"url\":\"',  m.url, '\"', " +
                               "',\"type\":\"', m.type, '\"}' " +
                               " ) " +
                               ") as json " +
                               "from menu m " +
                               "where  m.menu_name = 'main_menu' " +
                               "order by m.sort ASC; "));
        }
        public IEnumerable <WeatherForecast> Get()
        {
            var sql  = new CreatorSql();
            var data = sql.request("select cm.module from page p " +
                                   "LEFT JOIN content_page cp " +
                                   "on cp.page_id = p.content_page_id " +
                                   "LEFT JOIN content_module cm " +
                                   "on cp.content_module_id = cm.id " +
                                   "where " +
                                   "p.id = 1;");

            var rng = new Random();

            return(Enumerable.Range(1, 5).Select(index => new WeatherForecast
            {
                Date = DateTime.Now.AddDays(index),
                TemperatureC = rng.Next(-20, 55),
                Summary = data
            })
                   .ToArray());
        }