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

Struct Constructor - Ambiguous

3 Answers 53 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David Hollins
Top achievements
Rank 1
David Hollins asked on 02 May 2010, 03:31 PM
When using a struct as a persistent type, Open Access seems to add a parameterless constructor to the struct during enhancement.  This causes problems because then the "default" and this parameterles constructor make the std call to create this struct ambiguous.  C# forbids parameterless constructors on structs and this is causing an issue.

Has anyone else seen this and if so, was there a fix or workaround?

Thanks

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 03 May 2010, 04:36 PM
Hi David Hollins,
We are adding this parameterless ctor to the struct to initialize our change tracking and lazy loading. I never saw ambigious warnings because of that. Can you tell me where you see such and why it is a problem?

Kind regards,
Jan Blessenohl
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Hollins
Top achievements
Rank 1
answered on 24 May 2010, 06:10 PM
I usually see it when I am referencing one of these structs in our web code inside a page or control.  Visual Studio 2008 flags it as a problem but everything compiles alright and runs fine.

I have attached a screenshot showing the error in Visual Studio.
0
Jan Blessenohl
Telerik team
answered on 28 May 2010, 06:55 PM
Hello David Hollins,
I have digged into your problem today and my feeling is that the error is not reported by visual studio but by resharper or some other tool. Nevertheless I have found out that we might have misinterpreted the IL specification and we will see if we can get the same functionality with a different implementation.

Kind regards,
Jan Blessenohl
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Development (API, general questions)
Asked by
David Hollins
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
David Hollins
Top achievements
Rank 1
Share this question
or