IDictionary<T1,T2> value and key types

5 posts, 0 answers
  1. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 18 May 2009 Link to this post

    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
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 18 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 19 May 2009 Link to this post

    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]
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 20 May 2009 Link to this post

    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.
  6. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 21 May 2009 Link to this post

    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
Back to Top
DevCraft banner