maulin shah

maulin shah

  • NA
  • 158
  • 1k

Pass class objects from Angularjs to oDATAController.

Jul 28 2015 6:34 AM
In angularjs,I want to pass class object from Angularjs to oDATA Controller.But oDATA only accept int and string but not accept whole class object.I already set property of class data at front side but getting null at controller level when Post the data to Server side controller.
 
MemberListODController: 
 public PageResult<MemberSummaryView> GetMemberListOD(ODataQueryOptions<MemberSummaryView> options, string strCriteria, MemberListFilterCriteria objMemberListFilterCriteria)
{
 
 
MemberListDirective.js
 
var objMemberListFilterCriteria;
objMemberListFilterCriteria = {
FirstName: $scope.searchFirstName.toLowerCase(),
LastName: $scope.searchLastName.toLowerCase()
};
var MemberListGridData;
MemberListGridData = {
$inlinecount: "allpages",
$top: $scope.pageSize,
$skip: ($scope.pageSize * (page - 1)),
$orderby: sortBy,
$filter: null,
strCriteria: angular.toJson(objMemberListFilterCriteria),
MemberListFilterCriteria: angular.toJson(objMemberListFilterCriteria)
};
 so objMemberListFilterCriteria at controller it is null.Please suggest me if anyone have answer