This is a migrated thread and some comments may be shown as answers.

Ambiguous match found

3 Answers 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yang
Top achievements
Rank 1
Yang asked on 21 May 2014, 03:53 AM
I am using a customised linq to sql datacontext in a objectdatasource. When I add this datasource to a table, it shows error  'Ambiguous match found'. I think it's my Shadowed property that causes this error. Is there any work around? I need to use Shadows as I want to hide the property generated from  linq to sql datacontext and use my inherited class with pre-filtering.

This is what my customised datacontext looks like: 
Public Class ReportTestFiltered
  Inherits ReportTestDataContext
  Public Sub New()
    MyBase.New()
  End Sub
 
  Public Shadows ReadOnly Property Users() As IQueryable(Of User)
    Get
      Return MyBase.Users.Where(Function(x) x.Active).AsQueryable()
    End Get
  End Property
End Class

3 Answers, 1 is accepted

Sort by
0
KS
Top achievements
Rank 1
answered on 23 May 2014, 05:55 PM
Hi,

Check this - http://stackoverflow.com/questions/13032395/ambiguous-match-found
Still check if the data schema for User can be retrieved this way.

-KS

0
Yang
Top achievements
Rank 1
answered on 06 Jun 2014, 12:12 AM
That would work if I had the source code of object datasource. I haven't found a workaround it yet. 

0
IvanY
Telerik team
answered on 11 Jun 2014, 08:17 AM
Hello Yang Qu,

You should not be using shadow properties. In theory you can get with reflection all the properties with the same name. However there is no easy way to specify which property from which class you should be using. Therefore such scenario is not supported.

As a workaround you can create wrapper class that takes the information from your class. Then just use the wrapper class for your reports instead of the original class that has shadowed properties.

Regards,
IvanY
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Yang
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Yang
Top achievements
Rank 1
IvanY
Telerik team
Share this question
or