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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 452k
  • Answers 452k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Looks like you're over-complicating things. You could write a method… May 15, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer Return value is the value that a stored procedure returns,… May 15, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer Set the Panel1MinSize property. May 15, 2026 at 9:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.