I am trying to create a event listener function, which can render table from drawVisualisation(), when the page loads, but when I click on the controls[[categoryPicker(dropdownist), stringFilter(textbox)]], as the controls filter the data. When the user passes the filter, i would like the data to be filtered and render table using drawVisualisation2(). I have started the function and currently, its displaying only the controls, as I am little stuck, on the process of calling drawVisualisation2(), when state of the controls changes.

        //100,000 records of data
        function drawVisualization2(dataValues, chartTitle, columnNames, categoryCaption) {
            if (dataValues.length < 1)
                return;

            var data = new google.visualization.DataTable();
            data.addColumn('string', columnNames.split(',')[0], 'name');
            data.addColumn('number', columnNames.split(',')[1], 'price');
            data.addColumn('string', columnNames.split(',')[2], 'type');
            data.addColumn('datetime', columnNames.split(',')[3], 'date');

            for (var i = 0; i < dataValues.length; i++) {

                var date = new Date(parseInt(dataValues[i].Date.substr(6), 10));

                data.addRow([dataValues[i].ColumnName, dataValues[i].Value, dataValues[i].Type, date]);
            }

        }

        //==============================================================================================================================\\\

        // daily 100 records of data 
        function drawVisualization(dataValues, chartTitle, columnNames, categoryCaption) {
            if (dataValues.length < 1)
                return;

            var data = new google.visualization.DataTable();
            data.addColumn('string', columnNames.split(',')[0], 'name');
            data.addColumn('number', columnNames.split(',')[1], 'price');
            data.addColumn('string', columnNames.split(',')[2], 'type');
            data.addColumn('datetime', columnNames.split(',')[3], 'date');

            for (var i = 0; i < dataValues.length; i++) {

                var date = new Date(parseInt(dataValues[i].Date.substr(6), 10));

                data.addRow([dataValues[i].ColumnName, dataValues[i].Value, dataValues[i].Type, date]);
            }

            var monthformatter = new google.visualization.DateFormat({ pattern: "dd-MMM-yyyy" });
            monthformatter.format(data, 3);
                var categoryPicker = new google.visualization.ControlWrapper({
                    'controlType': 'CategoryFilter',
                    'containerId': 'control2',
                    'options': {
                        'filterColumnLabel': columnNames.split(',')[3],
                        'filterColumnIndex': '3',
                        'useFormattedValue': true,
                        'ui': {
                            'labelStacking': 'horizontal',
                            'allowTyping': false,
                            'allowMultiple': false,
                            'caption': 'Select Date Range',
                            'label': 'Date',
                        }
                    }
                });

                // Define a StringFilter control for the 'Name' column
                var stringFilter = new google.visualization.ControlWrapper({
                    'controlType': ...

Dear all,

I am trying to implement a method in api controller which only gets the yesterday date's data. I am new c# and mvc programming and I am not sure how to go about executing this task. I started the date method but currently its not filtering the data as desired and throwing error such as "Cannot convert lambda expression to type 'object[]' because it is not a delegate type"

public database_WICs Getdatabase_WICs(DateTime UploadDate)

        {
            string yesterday = DateTime.Today.AddDays(-1).ToShortDateString();
            database_WICs database_wics = db.database_WICs.Find(d => d.UploadDate == yesterday);

            if (database_wics == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return database_wics;
        }

Any help would be very much appreciated.

Thank you