2
votes

I am Using EntityFrameworkProvider in .net to query the ssas cube called “NorthwindEF”

I have a Measure in a ssas cube called "ProductCount".

When I run this MDX query SQL Server :

SELECT {[Measures].ProductCount]} ON COLUMNS FROM [NorthwindEF]

The output is : 123

I have created a custom class as follows

[MeasureGroup]

Public partial class Product

{

  Public int ProductCount { get ; set; }
}

Similarly I want to retrieve this in .net using .

static void Main()

{

  var context = NorthwindEFEntities.CreateForOlap();

  var result = context. ProductCount.Select(o => o.Quantity);

}

But when I execute the following query I am getting the error as:

{"Query (2, 1) The '[Product Count]' member was not found in the cube when the string, [Measures].[ Product Count], was parsed."} The querybuilder is automatically assuming ProductCount as Product Count ,which is generating the error.

Is there any way to avoid this?

This is the link which I followed:

http://www.agiledesignllc.com/GettingStartedGuide

1
should var result = context. ProductCount.Select(o => o.Quantity); be var result = context.Product.Select(o => o.Quantity);phil soady

1 Answers

0
votes

Use this:

Mdx.NamingConvention = new PreserveSpecifiedNameConvention();

in the class where you create the custom class similar to generated entity classes from EF. Thats it.