开发者

Domain Service returns expected, client receives empty result

开发者 https://www.devze.com 2023-04-13 09:07 出处:网络
I\'ve got an app where I created an empty Domain Service from the template.The domain service has a single method on it where I return a presentation model class that I project into with some LINQ stu

I've got an app where I created an empty Domain Service from the template. The domain service has a single method on it where I return a presentation model class that I project into with some LINQ stuff. Here's the method signature, etc. for the domain service:

[EnableClientAccess()]
public class StatisticsService : DomainService
{
    private ServiceInspectorEntities ctx = new ServiceInspectorEntities();

    [RequiresRole(RoleNames.Administrator, RoleNames.ServiceAdministrator)]
    public StatisticsPM GetStatistics(int DealerId, DateTime startDate, DateTime endDate)
    {
        // do LINQ 
        StatisticsPM stats = new StatisticsPM();
        // add LINQ results
        return stats;        // <- breakpoint here
    }

Here's the problem: I code on two different machines

  • desktop -> running VMWare Player with the virtual machine: WinServer2008, SQL Server 2008R2, .NET 4, IIS7, etc.
  • laptop -> running VMWare Fusion with the identical sourced virtual machine (I copied it from one to the other, so the environments are identical)

I sync the code between each using git/github

In the code above, I breakpoint the return statement:

  • desktop -> stats are as expected
  • laptop -> stats are as expected

Then I breakpoint the client side where I call the domain service and when it returns I inspect LoadOperation.Entities:

  • desktop -> LoadOperation.Entities are as expected (match what I returned on server side)
  • laptop -> LoadOperation.Entities are empty

LoadOperation.Error is null for both -- no errors at all

It is the second result here that baffles me. Same environment, same code, same results before being sent over the wire. Somewhere in the serialization process on either the client or server side the results are lost, and I'm looking for any clues from seasoned veterans who might say, "Oh yea, I've seen that before...you have to tweak such and such"...b/c I've quadruple checked my git status and database开发者_JAVA技巧 on each machine...done several clean builds and cleared the browser cache, etc., running out of ideas.

I haven't compared what Windows Update may have done between each Virtual Machine to verify if they have the same patch level / updates. It could be they are different, but I'm hoping it is something simpler.

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号