This question is locked. New answers and comments are not allowed.
I am using MvcTurbine/Ninject/db4o/Telerik MVC 2010.1.309 in a simple web site prototype.
I am now stuck debugging a WCF service, the 'Select' operation is being passed null for the GridState.
All the Dependency Injection works, the model correctly returns GetAll() in nUnit tests.
What would cause a null to be passed to GridState?
What am I missing?
thanks in advance...
WCF interface:
WCF service, markup included:
This is the view:
I am now stuck debugging a WCF service, the 'Select' operation is being passed null for the GridState.
All the Dependency Injection works, the model correctly returns GetAll() in nUnit tests.
What would cause a null to be passed to GridState?
What am I missing?
thanks in advance...
WCF interface:
| namespace Necropolis.Habitat.Services |
| { |
| using System.ServiceModel; |
| using Telerik.Web.Mvc; |
| [ServiceContract] |
| public interface IISO |
| { |
| [OperationContract] |
| GridModel Select(GridState _state); |
| } |
| } |
WCF service, markup included:
| namespace Necropolis.Habitat.Services |
| { |
| using System.Linq; |
| using System.ServiceModel; |
| using System.ServiceModel.Activation; |
| using Ninject; |
| using Telerik.Web.Mvc; |
| using Telerik.Web.Mvc.Extensions; |
| /* |
| <%@ ServiceHost Language="C#" |
| Debug="true" |
| Service="Necropolis.Habitat.Services.ISO" |
| CodeBehind="ISO.svc.cs" |
| Factory="Necropolis.Habitat.Infrastructure.DIServiceHostFactory" %> |
| */ |
| [ServiceBehavior(IncludeExceptionDetailInFaults = true)] |
| [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] |
| public class ISO : IISO |
| { |
| private Necropolis.ISO.Model.Contracts.Models.IISO_639_3_LanguageCode model_; |
| [Inject] |
| public ISO(Necropolis.ISO.Model.Contracts.Models.IISO_639_3_LanguageCode _model) |
| { |
| model_ = _model; |
| } |
| public GridModel Select(GridState _state) |
| { |
| // PROBLEM: |
| // |
| // _state == null |
| return (model_.GetAll().AsQueryable().ToGridModel(_state)); |
| } |
| } |
| } |
This is the view:
| <%@ Page Language="C#" |
| MasterPageFile="~/Views/Shared/Site.Master" |
| Inherits="System.Web.Mvc.ViewPage<IEnumerable<Necropolis.ISO.Model.Contracts.IISO_639_3_LanguageCode.View>>" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
| Home Page |
| </asp:Content> |
| <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
| <% |
| GridPagerStyles pagerStyles = GridPagerStyles.NextPreviousAndNumeric |
| | GridPagerStyles.PageInput |
| | GridPagerStyles.NextPrevious |
| | GridPagerStyles.Numeric; |
| Html.Telerik().Grid<Necropolis.ISO.Model.Contracts.IISO_639_3_LanguageCode.View>(Model) |
| .Name("Grid") |
| .DataKeys(keys => |
| { |
| keys.Add(c => c.GUID); |
| }) |
| .Columns(columns => |
| { |
| columns.Bound(o => o.Code).Width(80); |
| columns.Bound(o => o.RefName); |
| }) |
| .DataBinding(dataBinding => dataBinding |
| .WebService() |
| .Select("~/Services/ISO.svc/Select") |
| ) |
| .Groupable() |
| .Sortable() |
| .Pageable(paging => paging.Style(pagerStyles).PageSize(30)) |
| .Filterable() |
| .Scrollable() |
| .Footer(true) |
| .Render() |
| ; |
| %> |
| </asp:Content> |