mattjcowan / llblgenpro_ss_api_razor_templates Goto Github PK
View Code? Open in Web Editor NEWA set of LLBLGen Pro templates to generate a fully RESTful ServiceStack API and HTML interface to manage domain entities.
A set of LLBLGen Pro templates to generate a fully RESTful ServiceStack API and HTML interface to manage domain entities.
Matt, first I would like to thank you for such great templates. They are extremely helpful.
I'm having a problem with tables (entities) that are a part of a schema are not having their schema prefix persisted to the DB call.
I have an adventureworks table where the customers table belongs to a schema other than dbo. When I use the entity browser and navigate to the customer entitiy page, no records are returned. I traced the result back to the fact that the schema is not being carried to the call to the database. The final query sent to the DB is "SELECT COUNT(*) AS [LPAV_] FROM [Customer]", and results in a SQL "Invalid object name 'Customer'. I was able to verify the remedy by inserting a synonym for the table to map my schema to the schema of dbo.
Thanks again for this wonderful project.
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, Func
2 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, Dictionary
2 parameters, ICollection1 elementsToTraverse, EmitType emitTypeUsed, Func
2 nameProducerFunc, Func2 fullNameProducerFunc, Func
2 elementTypeNameProducerFunc, Func2 groupNameProducerFunc) at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutput(Dictionary
2 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, List
1 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, HashSet
1 spCallsToUse, HashSet1 typedViewsToUse, HashSet
1 typedListsToUse, HashSet1 valueTypesToUse, HashSet
1 tvfCallsTouse, List`1 vsNetProjectsCreated, LogNode& tasksResultLog)
If there is a field in LLBLgen that has been marked 'ReadOnly' then the generated code won't compile. This is because in template ss_svcimpl_EntityServiceRepository.lpt the code block at line 457 public static <%=entity.Name%>Entity FromDto(this <%=entity.Name%> dto) will generate a line to set a ReadOnly field.
When you build an Include statement – as in { Include = "category,supplier,orderdetails" })
If the developer doesn’t pay attention and puts a space after the comma, anything after comma wont load and no error will get thrown.
When trying to generate the Northwind code I get an error:
Exception type: NotImplementedException
The culture 'Dutch (Belgium)' is not supported. Pluralization is currently only supported for the English language.
Details:
LLBLGen Pro version 4.1. Build November 14th, 2013
-----[Core exception]--------------------
at System.Data.Entity.Design.PluralizationServices.PluralizationService.CreateService(CultureInfo culture)
at MJC_SS_V4_Svc_EntityGenericServiceTemplate.Pluralize(String text)
at MJC_SS_V4_Svc_EntityGenericServiceTemplate.__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.EmitOutput(Dictionary
2 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, List
1 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)
1 entitiesToUse, HashSet
1 spCallsToUse, HashSet1 typedViewsToUse, HashSet
1 typedListsToUse, HashSet1 valueTypesToUse, HashSet
1 tvfCallsTouse, List`1 vsNetProjectsCreated, LogNode& tasksResultLog)It is caused by these two lines in your templates:
System.Data.Entity.Design.PluralizationServices.PluralizationService.CreateService(System.Globalization.CultureInfo.CurrentCulture).Singularize(text);
and
System.Data.Entity.Design.PluralizationServices.PluralizationService.CreateService(System.Globalization.CultureInfo.CurrentCulture).Pluralize(text);
To fix it I changed System.Globalization.CultureInfo.CurrentCulture into
new System.Globalization.CultureInfo("en-US")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.