CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
PropertyHelper.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="PropertyHelper.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>internal implemetation to get a registered property</summary>
7//----------------------------------------------------------------------
8using System;
9using System.Linq;
10using Csla.Core;
12using Csla.Rules;
13
14namespace Csla.Validation
15{
16 internal static class PropertyHelper
17 {
18 public static IPropertyInfo GetRegisteredProperty(BusinessRules businessRules, string propertyName)
19 {
20 var rules = (IBusinessRules) businessRules;
21 var target = rules.Target;
22 var primaryProperty = PropertyInfoManager.GetRegisteredProperty(target.GetType(), propertyName);
23
24 if (primaryProperty == null)
25 throw new ArgumentException(string.Format("Unkonwn property. {0} is not a registered field", propertyName));
26
27 return primaryProperty;
28 }
29 }
30}
Tracks the business rules for a business object.
Maintains metadata about a property.
Public interfacefor IBusinessRules