CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

CodeSmith C# Templates on Codeplex

Last post 12-12-2008, 1:34 PM by jnapoli. 35 replies.
Page 1 of 3 (36 items)   1 2 3 Next >
Sort Posts: Previous Next
  •  02-21-2008, 7:13 PM 21515

    CodeSmith C# Templates on Codeplex

    I have just posted a preview version of new CodeSmith templates to support CSLA 3.5.  Please give it a try and I'm looking forward to your feedback (good or bad).  I currently on have EditableRoot, EditableChildList, and EditableChild.  Other templates will be comming soon.

    Some notable changes from the earlier version:

    Support for Linq To SQL:
    Generates CRUD operations for Linq to SQL.  Support optimistic concurrency through timestamp. 

    Split Base no longer supported:
    The new compiler trick with partial method provide much better implementation therefore I feel like the split base method is no longer needed.  I chosed to drop the Split with base class method to reduce the complexity of the templates.

    N-level deep child support:
    Although I've never needed, but if anybody needs it, thanks to Linq To SQL that make it possible, the templates will support it.

    So please give it a try and let me know what do you think.  Hopefully I can beat Rocky with the release Big Smile [:D]
    http://www.codeplex.com/CSLAcontrib/SourceControl/ListDownloadableCommits.aspx

    Ricky
  •  02-21-2008, 8:44 PM 21518 in reply to 21515

    Re: CodeSmith C# Templates on Codeplex

    Very cool and good timing Ricky.

    I will go and try them out Smile [:)]

    Thanks,

    Patrick

  •  02-25-2008, 4:29 PM 21586 in reply to 21515

    Re: CodeSmith C# Templates on Codeplex

    Ricky,

    you rock :)

     

    Ash

  •  02-27-2008, 2:14 PM 21664 in reply to 21515

    Re: CodeSmith C# Templates on Codeplex

    How do we use the new 3.5 templates? Do we need to have the commercial version of CodeSmith or we can use them with the project listed here http://www.cslagenwiki.com/~cslagenw/mediawiki001/index.php?title=Main_Page

    Thanks

  •  02-28-2008, 12:24 AM 21683 in reply to 21664

    Re: CodeSmith C# Templates on Codeplex

    Like previous version.  This templates are built to work only with the free version of CodeSmith.  The too can be download http://www.codesmithtools.com/freeware.aspx.  However I have received feedback that the previous version would work just fine with the commercial version of CodeSmith.

    Loved to hear feedback from others if they still work.


  •  02-28-2008, 11:48 AM 21698 in reply to 21683

    Re: CodeSmith C# Templates on Codeplex

    For csla version 2.xx I am using the open source project updated lastly by Andres Villanueva. I just click on CslaGenerator.exe and then point on a db, pick a table and business object type and then generated the code. I am not familiar of how to make your templates/project work with CodeSmith 2.6. I did download the free version of CodeSmith but could not figure out how to call the 3.5 templates. Can you please summarize the process of how to make them work? Probably I need to get more familiar with codesmith itself.

    Thanks

  •  02-28-2008, 6:43 PM 21708 in reply to 21698

    Re: CodeSmith C# Templates on Codeplex

    I haven't have the time to update the readme file for this version.  However the readme file from previous version should probably help you as there are very little change from previous version.

    You do need to be familiar on how to use CodeSmith.  Most people that use code generation usually make minor modification to suit their progamming need.

    Other than the source control, you can also download the previous version here

    HTH
  •  02-29-2008, 3:37 PM 21740 in reply to 21708

    Re: CodeSmith C# Templates on Codeplex

    I am doing some progress on my end. I clicked on CodeGenTemplates\CodeSmith\CSLA35\CSharp\EditableRoot.cst
    and CodeSmith launched.
    Entered an ObjectName
    Went to RootTable and created a new connection to our sql. From the table list I select a table.
    Clicked on generate and get this error message

    System.Exception: Unique Column(s) is required.
       at CodeSmith.Csla.TemplateBase.ObjectInfo.Validate()
       at CodeSmith.Csla.TemplateBase.ObjectInfo..ctor(CodeTemplate template)
       at _CodeSmith.EditableRoot_cst.__RenderMethod1(TextWriter writer, Control control)
       at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
       at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
       at CodeSmith.Engine.Control.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.RenderToString()
       at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)

    ResultSetIndex=0.  What am I missing?

    Thanks

     

  •  02-29-2008, 3:58 PM 21742 in reply to 21740

    Re: CodeSmith C# Templates on Codeplex

    As I recall, a lot of template code was written assuming your tables have Primary Keys and maybe unique indexes. Does the table have a PK?

    Joe

     

  •  03-03-2008, 10:58 AM 21791 in reply to 21742

    Re: CodeSmith C# Templates on Codeplex

    You are right. I only had a unique index. After dropping the unique index and creating a primary key, the template works.

    Thanks

     

  •  05-03-2008, 9:51 PM 23318 in reply to 21515

    Re: CodeSmith C# Templates for 3.5?

    rasupit:
    Hopefully I can beat Rocky with the release Big Smile [:D]

    Hi Ricky,
    I was just wondering how you are going with the templates for CSLA.NET 3.5? Smile [:)]
    I really like the ability to generate the code from XML with your templates.

    Thanks for all your effort,
    Patrick
  •  05-06-2008, 12:12 AM 23351 in reply to 21515

    Re: CodeSmith C# Templates on Codeplex

    is there any chance of similar csla 3.5 templates for VB .NET coming up?
  •  05-06-2008, 5:28 PM 23374 in reply to 21515

    Re: CodeSmith C# Templates on Codeplex

    Hello,

    First thanks for the work on the templates, they're nice!Smile [:)]

    One question I had concerns the updating code in the DataPortal_Update() method.  It seems that if I have a BO created and update a property, but before I submit submit the changes, another user happens to be working with the same record and submits his changes first. Won't the first change wipe out the changes from the second? 

    i.e.  if the original DB record has firstname=tom and lastname=smith and user #1 changes firstname to mike, but before he submits his change, user #2 submits lastname=jones.  After user #1 submits, I would think it should be tom jones, but it seems like it will be tom smith.  Is this something that is taken care of at a different layer or should there be an error thrown or is this just a design decision?

    Thanks!

    Mike

     

  •  05-06-2008, 8:46 PM 23377 in reply to 23318

    Re: CodeSmith C# Templates for 3.5?

    Patrick,
    Thanks for the reminder.  I had been side tracked and turned my attention away from this.  I'll continue to work on the other stereotypes.  In the mean time... for anybody that have not already try with it.  please give it a try and keep the feedback coming.

    Ricky
  •  05-06-2008, 9:04 PM 23378 in reply to 23374

    Re: CodeSmith C# Templates on Codeplex

    pandelaras,
    Like the previous version, hopefully somebody will volunteer and enhance the existing vb version.  It shouldn't be too much work.

    Mike,
    The answer is optimistic concurrency.   The book and sample project explain how to implement this type of concurrency to address this kind of scenario.  The template also support optimistic concurrency.
Page 1 of 3 (36 items)   1 2 3 Next >
View as RSS news feed in XML

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems