Hello
Currently evaluating LLBLGen and as it looks now I'm probably going to buy it... there's something about taking a template and modifying it, generating code that does exactly what I want and then generating unit tests for the code I just generated that makes me feel happy inside =)
Anyway, I've run into something that is probably a newbie problem that would easily be resolved by actually buying LLBLGen and downloading the SDK and Template editing tool (?), but I have to get permission to buy it first, and I'm impatient.
I have a base entity called Part, with CustomPart and StandardPart (Yeah, I know, a standard part should be a part! ) that inherits from it. Works perfectly fine.
Part - Abstract:
- ID int primary key
- CategoryID int references Category entity
- Bunch of other regular varchars
StandardPart
- ID int primary key references Part.ID 1:1
- shipping int
- bunch of varchars
CustomPart
- ID int primary key references Part.ID 1:1
However, I've been modifying the Manager templates and have run into a problem with the Create method that is generated.
This is from EntityManagerBaseTemplate
<%
ArrayList writableFieldRelationPairs = GetWritableFieldRelationPairs(Entity);
ArrayList writableFields = FieldRelationPair.ToFieldList(writableFieldRelationPairs);
ArrayList minimalFieldRelationPairs = GetMinimalFieldRelationPairs(Entity);
ArrayList minimalFields = FieldRelationPair.ToFieldList(minimalFieldRelationPairs);
%>
/// <summary>
/// Creates a full <c><%=ObjectName%>Entity</c>
/// </summary>
<%=BuildParamComments(writableFields)%>
/// <returns>A populated <c><%=ObjectName%>Entity</c>.</returns>
public static <%=ObjectName%>Entity Create(<%=BuildFieldParameterList(writableFields)%>)
The writableFields variable (when generating the StandardPartManager) does not seem to contain the CategoryID or the varchars from Part, so the object that is created isn't really "full".
From what I've been able to see from looking at the template file with no color coding, the GetWritableFieldRelationPairs is a function included in the template, but thats about as far as it gets for me using notepad.
Was kind of hoping someone had experience with these templates and could point me in the right direction...
I guess it could be me configuring something in a weird way in the designer too, but the relation seems to work fine.