Otis wrote:
BHerbert wrote:
Hi
I am using LLBLGEN for NHibernate code generation and need to edit the templates to get the desired DAL classes generated, problem is there is no SDK docs for the template objects used or even examples i have seen yet demonstrating sample templates or code snippets !
Why do you need to alter the templates to get the classes generated? The classes are generated. What exactly do you need changed?
Other than that, there's the SDK docs, which document the template system and the 'LLBLGen Pro v3.1 designer / algorithmia assemblies reference manual' which describes the objects used in the templates. I think you missed that one. It describes all objects used in the templates, and should help you understand where to obtain meta-data.
Was trying to change the Mapping generation to add .Length() !
Didn't see were to change this from the designer properties !
How can i do that with out altering the templates ?
Below is what i have changed (template: entityFluentMapping.lpt, line 430)
//sb.AppendFormat(".Access.CamelCaseField(Prefix.Underscore);{0}", Environment.NewLine);
// Added to cater for DB column text length (Herbert 15/07/2011)
sb.Append(".Access.CamelCaseField(Prefix.Underscore)");
if(field.FieldType.RepresentedType == typeof(string))
{
sb.AppendFormat(".Length({0})", field.MaxLength.ToString());
}
sb.AppendFormat(";{0}", Environment.NewLine);