Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLBLgen 'Unique constraints' not handled well #3

Open
robsiera opened this issue Dec 31, 2013 · 1 comment
Open

LLBLgen 'Unique constraints' not handled well #3

robsiera opened this issue Dec 31, 2013 · 1 comment

Comments

@robsiera
Copy link

Error in regard to template ss_svc_EntityService.lpt
at line 278: foreach(var ucFieldName in uc.FieldsAsString.Split(',')
This line fails if there is a unique constraint defined in LLBLgen.
Exception type: InvalidOperationException: Sequence contains no matching element

LLBLGen Pro version 4.1. Build November 14th, 2013
-----[Core exception]--------------------
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at MJC_SS_Svc_EntityServiceTemplate.__ScriptCode()
at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutputToFile[TElement](TElement currentElement, String destinationFilename, Boolean failWhenExistent, Assembly compiledTemplatesAssembly, String templateID, Dictionary2 parameters, Boolean isPartOfSet, String outputDescription) at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutputForElements[TElement](String destinationFolderFormat, String filenameFormat, Boolean failWhenExistent, String templateID, Assembly compiledTemplatesAssembly, Dictionary2 parameters, ICollection1 elementsToTraverse, EmitType emitTypeUsed, Func2 nameProducerFunc, Func2 fullNameProducerFunc, Func2 elementTypeNameProducerFunc, Func2 groupNameProducerFunc) at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutput(Dictionary2 parameters, String destinationFolderFormat, String templateID, Assembly compiledTemplatesAssembly, EmitType emitTypeToPerform, String filenameFormat, Boolean failWhenExistent)
at SD.LLBLGen.Pro.LptParser.DotNetTemplateEngine.Perform(IGenerator executingGenerator, ITask taskDefinition, Dictionary2 parameters) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.Task.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroup.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroup.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroup.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.GeneratorCore.Generator.RunTasks(String rootNameSpaceToUse, String destinationRootFolder, String groupName) at SD.LLBLGen.Pro.GeneratorCore.Generator.Start(ITaskGroup tasksToExecute, ApplicationConfiguration configurationSettings, Language languageToUse, Platform platformToUse, List1 templateBindingsToUse, String templateGroupToUse, String rootNameSpaceToUse, String destinationRootFolder, Project projectDefinition, CodeGenerationCycleOutputType outputType)
at SD.LLBLGen.Pro.GeneratorCore.Generator.Start(ITaskGroup tasksToExecute, CodeGenerationCyclePreferences preferences, ApplicationConfiguration configurationSettings, Project projectDefinition)
at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRunCodeGenerationCycleAction(ITaskGroup toExecute, CodeGenerationCyclePreferences codeGenerationCyclePreferences, HashSet1 entitiesToUse, HashSet1 spCallsToUse, HashSet1 typedViewsToUse, HashSet1 typedListsToUse, HashSet1 valueTypesToUse, HashSet1 tvfCallsTouse, List`1 vsNetProjectsCreated, LogNode& tasksResultLog)

@mattjcowan
Copy link
Owner

I'm guessing it's failing somewhere else, on an IEnumerable somewhere... Maybe in one of the following lines? allEntityFields.Single(f=>f.Name==ucFieldName);

Do you have any tables with only discriminators? missing PKs?

My tests generate fine at this point, but maybe I'm missing something (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants