Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Simple question on where clause

$
0
0

I see this referenced in the user manuals .Where("update_user", Session["UserName"], "=") But how do I use a cookie call in the where statement instead? I am thinking I just don't understand the info because only a few lines are displayed in the sample code.
Entire code:

using System.Web;
using System.Web.Http;
using DataTables;
using WebApiExamples.Models;

namespace WebApiExamples.Controllers
{

    public class module_userController : ApiController
    {
        [Route("api/module_user")]
        [HttpGet]
        [HttpPost]
        public IHttpActionResult module_user()
        {
            var request = HttpContext.Current.Request;
            var settings = Properties.Settings.Default;


            using (var db = new Database(settings.DbType, settings.DbConnection))
            {
                var response = new Editor(db, "Modules")
                    .Model<module_userModel>()

                    .TryCatch(false)
                        .Field(new Field("Module"))
                        .Field(new Field("URL"))
       .Where("update_user", , "=")


                    .Process(request)
                    .Data();

                return Json(response);

            }


        }

    }

}

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.


Viewing all articles
Browse latest Browse all 2364

Trending Articles