Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 782259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:21:32+00:00 2026-05-14T20:21:32+00:00

I’ve got the a class created in code an added it to my class

  • 0

I’ve got the a class created in code an added it to my class diagram. The class diagram is used by a text template generatorto generate code from this class diagram. I’m trying to map a dictionary to an sql database with NHibernate, the generated mapping looks ok to me, but the class property as shown below is giving me problems.

This is the property;

[Map(2, Name = "QuantityIdentifiers", Table = "PluginProduct_QuantityIdentifiers")]
        [Key(3, Column = "ItemId")]
        [Index(4, Column = "Id", Type = "string")]
        [Element(5, Column = "QuantityType", Type = "string")]
        public virtual IDictionary<string, string> QuantityIdentifiers
        {
            get { return _identifiersVariants; }
            set { _identifiersVariants = value; }
        }

This is the part of the mapping which is also being generated within the application i’m working on;

<map name="QuantityIdentifiers" table="PluginProduct_QuantityIdentifiers" cascade="all">
      <index column="Id" type="string" />
      <element column="Type" type="String" />
    </map>

When i’m using the T4 toolbox from Microsoft to generate from the class diagram i’m getting the following error;

Error 235 Running transformation: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Microsoft.VisualStudio.TextTemplating6FC9B85C3A64B0406665113D095DEF7E.GeneratedTextTransformation.controllerTemplate.TransformText() in c:\Projects\site\PluginGenerator\controllerTemplate.tt:line 722
   at T4Toolbox.Template.Transform()
   at T4Toolbox.Template.Render()
   at Microsoft.VisualStudio.TextTemplating6FC9B85C3A64B0406665113D095DEF7E.GeneratedTextTransformation.generateFiles.RunCore() in c:\Projects\site\CMS.PluginGenerator\generateFiles.tt:line 74
   at T4Toolbox.Generator.Run()
   at Microsoft.VisualStudio.TextTemplating6FC9B85C3A64B0406665113D095DEF7E.GeneratedTextTransformation.TransformText() in c:\Projects\site\Product\Generator\PluginGenerator.tt:line 18
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)  1 1 

I hope someone can help me explaining and finding out where this error is coming from. Been stuck on this problem for nearly two days now..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:21:32+00:00Added an answer on May 14, 2026 at 8:21 pm

    In the end i was able to work around it because we changed the design for the application for several reasons, nevertheless i still don’t know how to map an iDictionary to the database. So if someone has a solution, answers are welcome! For know the problem is solved by a design modification

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.