I think you also need to uncomment the child and parent creations in 
WriteClassCtor that writes the class constructor (marked by !DEBUG section).

        protected virtual void WriteClassCtor(CodeWriter writer, Table 
table, Database schema, GenerationContext context)
        {
            using (writer.WriteRegion("ctor"))
            using (writer.WriteCtor(SpecificationDefinition.Public, 
table.Type.Name, new ParameterDefinition[0], null))
            {
#if !DEBUG
                // children are EntitySet
                foreach (var child in GetClassChildren(table))
                {
                    // if the association has a storage, we use it. 
Otherwise, we use the property name
                    var entitySetMember = child.Storage ?? child.Member;
                    writer.WriteLine(writer.GetStatement(
                        writer.GetAssignmentExpression(
                            entitySetMember,
                            
writer.GetNewExpression(writer.GetMethodCallExpression(
                                
writer.GetGenericName(TypeExtensions.GetShortName(typeof(EntitySet<>)), 
child.Type),
                                GetChildAttachMethodName(child),
                                GetChildDetachMethodName(child)
                            ))
                        )
                        ));
                }
                // the parents are the entities referenced by a FK. So a 
"parent" is an EntityRef
                foreach (var parent in GetClassParents(table))
                {
                    var entityRefMember = parent.Storage;
                    writer.WriteLine(writer.GetStatement(
                        writer.GetAssignmentExpression(
                            entityRefMember,
                            
writer.GetNewExpression(writer.GetMethodCallExpression(
                            
writer.GetGenericName(TypeExtensions.GetShortName(typeof(EntityRef<>)), 
parent.Type)
                            ))
                        )
                    ));
                }
#endif

--------------------------------------------------
From: "Craig" <[email protected]>
Sent: Friday, July 10, 2009 10:22 AM
To: "DbLinq" <[email protected]>
Subject: [dblinq] Re: dblinq MySQL newbie questions

>
> The option needs to go in
>
> namespace DbMetal.Generator.Implementation.CodeTextGenerator
>        protected virtual void WriteClass(CodeWriter writer, Table
> table, Database schema, GenerationContext context)
>                WriteClassChildren(writer, table, schema, context);
>                WriteClassParents(writer, table, schema, context);
>                WriteClassChildrenAttachment(writer, table, schema,
> context);
>
> If I comment out these lines i get what i need.
>
> Got another bug report. The code generator is not returning "unsigned"
> values for a column on TINYINT fields. I dont know about other numeric
> types yet. I have a "-1" in my tinyint and it is returning "1".
>
>
> >
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to