From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books
Great work on the templates; however, I'm wondering you didn't incorporate the private backing field to all properties?
For regular CSLA I am not sure it makes a difference. Need to read the book when it comes out though.
But for CSLA Lite - (Silverlight) - I think it works best with managed fields.
Joe
Patrick:I really like the ability to generate the code from XML with your templates.Thanks for all your effort,Patrick
Patrick:the old release of the templates for CSLA.NET 2.0 contained these filesCslaXml.cstCsla.cstCslaProject.xsdMySample.xml
Hi hampole
Have a look at the PTracker example. Look in the ProjectTracker.DalLinq project in the solution.
From project.cs in Library
using (var ctx = ContextManager<ProjectTracker.DalLinq.PTrackerDataContext>.GetManager(ProjectTracker.DalLinq.Database.PTracker)) { // get project data var data = (from p in ctx.DataContext.Projects <-- where p.Id == criteria.Value select p).Single(); LoadProperty<Guid>(IdProperty, data.Id); LoadProperty<string>(NameProperty, data.Name); LoadProperty<SmartDate, System.DateTime?>(StartedProperty, data.Started); LoadProperty<SmartDate, System.DateTime?>(EndedProperty, data.Ended); LoadProperty<string>(DescriptionProperty, data.Description); mTimestamp = data.LastChanged.ToArray();
// get child data LoadProperty<ProjectResources>(ResourcesProperty, ProjectResources.GetProjectResources(data.Assignments.ToArray())); }
This links to PTracker.dbml in DalLinq
database markup language (.dbml) metadata file.
Once you have your Data Sources connected, you should be able to drag everything you need from the Data Sources window.
Yes you will need to add a new dbml object to your project.