CSLA .NET 对象模板详解
在软件开发中,CSLA .NET 提供了多种对象模板,这些模板可以帮助开发者更高效地构建业务对象。下面将详细介绍几种常见的 CSLA .NET 对象模板。
1. 只读子集合(Read-Only Child Collection)
只读子集合与只读根集合非常相似,主要区别在于工厂方法和数据访问。以下是只读子集合的代码示例:
[Serializable]
public class ReadOnlyChildList :
ReadOnlyListBase<ReadOnlyChildList, ReadOnlyChild>
{
#region Authorization Rules
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowGet(typeof(ReadOnlyChildList), "Role");
}
#endregion
#region Factory Methods
internal static ReadOnlyChildList GetReadOnlyChildList(object childData)
{
return DataPortal.FetchChild<ReadOnlyChildList>(childData);
}
private
超级会员免费看
订阅专栏 解锁全文
69

被折叠的 条评论
为什么被折叠?



