ajax - Lambda fetching multiple records with contains query returns empty -


i have code:

public jsonresult ekranbilgilistele(list<int> ids) {     dbreklam db = new dbreklam();     //int[] ids = { 14, 16 }; ids comes     db.configuration.proxycreationenabled = false;     var secilenekranlar = db.tbl_ekranlar.where(ekranlar => ids.contains(ekranlar.sektorid));     return json(secilenekranlar); } 

and ajax call:

$.ajax({     type: 'post',     url: '@url.action("ekranbilgilistele")',     datatype: 'json',     data: { ids: arraysecilenekranlarid },      success: function (data) {         console.log('---->' + data.ekranad);     },     datatype: "json",     traditional: true }); 

however, using breakpoints , results view returns 'empty' , console returns 'undefined'

really sorry wrote wrong query!

writing right one.

public jsonresult ekranbilgilistele(list<int> ids)     {         //int[] ids = { 14, 16 }; ids comes         db.configuration.proxycreationenabled = false;         var secilenekranlar = db.tbl_ekranlar.where(ekranlar => ids.contains(ekranlar.ekranid));         return json(secilenekranlar);     } 

ajax code, changed little bit:

$.ajax({             type: 'post',             url: '@url.action("ekranbilgilistele")',             datatype: 'json',             data: { ids: arraysecilenekranlarid },             success: function (secilenekranlar) {                 $.each(secilenekranlar, function (i, ekranlar) {                     console.log(ekranlar.ekranad);                 });             },             error: function (ex) {                 alert('İlçeler Çekilemedi.' + ex);             }         }); 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -