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

IDictionary<T1,T2> value and key types

4 Answers 47 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.
James Denning
Top achievements
Rank 1
James Denning asked on 18 May 2009, 01:06 PM
Hi there
When forward mapping fields of type IDictionary can you clarify the docuemntation - do the restrictions on Value and Key types for the IDictionary remain the same as that specified for non-generic collections that need the ItemTypeAttribute? The documentation seems to refer to the old style fields where the "The element (item) type can be any type that is allowed for a simple persistent field" ("Map and Collection Fields" in programmers guide mapping section). What I want to do is specify IDIctionary fields where the key and value types are defined by myself as persistent classes or with a string for the key value.

Currently I am getting a runtime (not designer) error "Incomplete model information for map : <my field> of class <my class>", where the field is an IDictionary type field but I am thinking I have done something wrong.

Many thanks
James Denning

4 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 18 May 2009, 05:57 PM
Hello James Denning,
It should work like it is described for itemtype. Which key and value type did you specify? From our code it looks like we can not determine one of the types.

Sincerely yours,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James Denning
Top achievements
Rank 1
answered on 19 May 2009, 03:05 PM
Ok - if you get this error it means that the config is wrong - especially the references, embed the config in the assembly then ensure you put reference elements that refer to all required enhanced assemblies in the app,config of the application that needs to use these assemblies (my mistake):
You must specify the element-type (or value-type for maps) for collections (and maps) for field '_documents' or class 'Pinpoint.EIS.Core.Consultant' needs to be enhanced, but wasn't. --> (.NET app conf file):mapping-id=mssqlMapping/namespace[Pinpoint.EIS.Core]/class[Consultant]
0
Jan Blessenohl
Telerik team
answered on 20 May 2009, 10:22 AM
Hi James Denning,
The forward mapped dictionary will also work without any mapping information. What exactly was wrong in your config files?

Is it working now?

Best wishes,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James Denning
Top achievements
Rank 1
answered on 21 May 2009, 07:42 AM
Hi
The mistake I made was copying hte mapping config file from the main class library to the cobnsole application when all i needed to do was ensure the conbsole's config file contained OpenAccess reference elements to the relevant assemblies, not the whole mapping elements.
Regards
James
Tags
Development (API, general questions)
Asked by
James Denning
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
James Denning
Top achievements
Rank 1
Share this question
or