locked
MarketMetrics does not have a corresponding Metrics settable property RRS feed

  • Question

  • I have a wcf data service backed by the reflection provider. one of my projection query as follow:

              var metrics = from p in proxy.Market
                                   where p.PassportAge >= 0 && (p.PassportAge <= 100 || p.SearchQuery.Contains("a")) && p.PassportCountry != p.Location.Country
                                   select new MarketMetrics { TrackingID = p.Metrics.TrackingID, TopOfBehaviors = p.Metrics.TopOfBehaviors };  

    I make the call asynchrously.

                    proxy.BeginExecute<MarketMetrics>(url, ac =>
                    {
                        var result = proxy.EndExecute<MarketMetrics>(ac);
                        foreach (var item in result)
                        {
                            Console.WriteLine(item.TrackingID);
                        }
     
                    }, null);
     I got an error: MarketMetrics does not have a corresponding Metrics settable property
    Is anyone know what's the root cause?
     
    Thursday, December 22, 2011 12:18 PM

All replies

  • Could you please share the definition of the MarketMetrics class? Or if possible all the entity classes in the above query (I can't tell all the names from the query though).

    Or alternatively the output of the $metadata of your service.

    Thanks,


    Vitek Karas [MSFT]
    Thursday, December 22, 2011 1:23 PM
    Moderator
  • The definition of the MarketMetrics as follow

    :

    [DataServiceKey("TrackingID")]
        public class MarketMetrics
        {
            /// <summary>
            /// string represent of the user select
            /// </summary>
            public Guid TrackingID { get; set; }
    
            /// <summary>
            /// Distribution of profile of selected audience
            /// </summary>
    
            // Total reach in the specified time range
            public int TotalReach { get; set; }
    
            // Daily reach distribution 
            public DistOfDemographics DailyDistOfDemographics { get; set; }
    
            // Weekly reach distribution
            public DistOfDemographics WeeklyDistOfDemographics { get; set; }
    
            // Monthly reach distribution
            public DistOfDemographics MonthlyDistOfDemographics { get; set; }
    
            /// <summary>
            /// Top of behaviors of selected audience
            /// </summary>
            public TopOfBehaviors TopOfBehaviors { get; set; }
    
            /// <summary>
            /// @TODO: merge with top of behaviors?
            /// </summary>
            public RelevanceSegments TopReleventSegments { get; set; }
        }
    

    As you have seen, the Metrics is one property of Market, it seems it's mapped to the WRONG entity.

    Monday, December 26, 2011 3:37 AM
  • It seems something wrong with your first query. You can try to run it alone to see if it is right. Not sure whether the Anonymous Type is good here.


    I am fish.
    Wednesday, December 28, 2011 1:02 PM
  • I tried to repro this, but no luck so far.

    Could you please share the definition of the Market class as well? And maybe the relevants parts of the $metadata of the service in question.

    If you have a sharable repro project feel free to send it to vitek dot karas at microsoft dot com.

    Thanks,


    Vitek Karas [MSFT]
    Thursday, December 29, 2011 11:59 AM
    Moderator