Grins #ly
---------------------------------------------------------------------------------------
using
System;using System.Diagnostics;
using
Csla;using
Csla.Core;namespace
SomeNamespace{
[Serializable()]
public class RootList: EditableRootListBase<Root>
{
#region
Business Methodsprotected override object AddNewCore()
{
Root item = Root.NewRoot;
Add(item);
Debug.WriteLine("Added " + this.Count -1);
return item;
}
#endregion
#region
Factory Methodspublic static RootList GetList()
{
return DataPortal.Fetch<RootList>(new Criteria());
}
private RootList()
{
this.AllowEdit = true;
this.AllowNew = true;
this.AllowRemove = true;
}
#endregion
#region
Data Access[Serializable()]
private class Criteria
{
}
protected override void DataPortal_Fetch(Criteria criteria)
{
// Load list here.
}
#endregion
}
}
----------------------------------------------------------------------------------------------------
I think I got it all...
Mark Haley
I guess the template name should be RootList.cs (and not EditableRootListBase.cs). Correct?
From: tiago [mailto:cslanet@lhotka.net]
Sent: Monday, December 04, 2006 7:07 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] EditableRootListBase example
Hi,
This is Editable Root List base, the methods for update, delete and Add new is not there is the example. Can you please elaborate your example for more details.
Thanks & Regards
Rashid
For full details see the CSLA .NET Version 2.1 Handbook ebook.
An ERLB collection contains editable root objects, so each "child" object is responsible for its own insert/update/delete.
Copyright (c) Marimer LLC