CSLA .NET

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

CodeSmith C# Templates on Codeplex

This post has 36 Replies | 8 Followers

Not Ranked
Posts 9
hampole replied on Thu, Sep 25 2008 7:17 PM
Thanks. I have little bit progressed now. I used the Microsoft tool SqlMetal.exe to generate the dbml file. Once I added to the project, DataContext class was created. I am having some other problems. The CodeSmith generated code snippet for fetch is as follows. I don't see any method by name Single in DataContext class. Do I need to do anything to generate that? please help.

        private void DataPortal_Fetch(SingleCriteria<StateProvince, int> criteria)
        {
            using (var mgr = ContextManager<Dal.RMDBDataContext>
                        .GetManager(Database.RMDB))
            {
                var data = mgr.DataContext.RMStateProvinces
                        .Single(r => r.StateProvinceID == criteria.Value);

                StateProvinceID = data.StateProvinceID;
                StateProvinceName = data.StateProvinceName;
                StateProvinceCode = data.StateProvinceCode;
                CountryRegionID = data.CountryRegionID;
                CreatedDate = data.CreatedDate;
                UpdatedDate = data.UpdatedDate;
                CreatedUserID = data.CreatedUserID;
                UpdatedUserID = data.UpdatedUserID;
            }//using
        }

Top 500 Contributor
Posts 26
zinovate replied on Mon, Sep 29 2008 11:14 PM

There is a project type called "Linq to SQL Classes" in VS 2008.

It provides a visual designer and drag and drop support from the data sources window. That's your best path for Linq 2 SQL development.

Top 500 Contributor
Posts 26
zinovate replied on Mon, Sep 29 2008 11:18 PM

Single is part of the Linq Extension methods.

Here's a good source of info on Linq.

 http://msdn.microsoft.com/en-us/netframework/aa904594.aspx 

Top 10 Contributor
Posts 3,694
Andy replied on Tue, Sep 30 2008 7:33 AM
SqlMetal is perfectly valid as well, and it's use is recommended if you want a bit more control over the generated classes.

To answer the OPs question, it may be that System.Linq isn't being referenced via a using clause.
Not Ranked
Posts 1
ebaytok replied on Sun, Nov 2 2008 1:56 PM

I haven't been able to locate the codesmith templates for net3.5.  Can you post a link? --Thanks.

Not Ranked
Posts 2
jnapoli replied on Fri, Dec 12 2008 1:34 PM

I have to admit, i am new to the templates.  And I've just tried playing with the templates EditableRootList and EditableRoot for 3.5 version.  Not having any luck. 

Have you gotten any other feedback? 

 

 

 

 

 

 

 

Top 50 Contributor
Posts 129

Hello,

If you are working with CSLA 3.8, we have a set of templates that really goes beyond the CSLA Contrib templates. I've tried to make the migration from CSLA Contrib to our templates as easily as possible. Please check out a nightly build, we have added support for SQL Stored procedures as well as object factory.

Thanks

-Blake Niemyjski

 

Thanks

-Blake Niemyjski (Author of the CodeSmith CSLA templates).

 

Page 3 of 3 (37 items) < Previous 1 2 3 | RSS

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?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems