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..