9using System.Collections.Generic;
10using System.ComponentModel;
16using System.Linq.Expressions;
18using System.Reflection;
19using System.Threading.Tasks;
48 Csla.Server.IDataPortalTarget,
Csla.Core.IManageProperties,
83 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Usage",
"CA1801:ReviewUnusedParameters", MessageId =
"criteria")]
84 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1822:MarkMembersAsStatic")]
85 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1811:AvoidUncalledPrivateCode")]
86 private void DataPortal_Create(
object criteria)
91 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Usage",
"CA1801:ReviewUnusedParameters", MessageId =
"criteria")]
92 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1822:MarkMembersAsStatic")]
93 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1811:AvoidUncalledPrivateCode")]
94 private void DataPortal_Fetch(
object criteria)
99 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1822:MarkMembersAsStatic")]
100 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1811:AvoidUncalledPrivateCode")]
101 private void DataPortal_Update()
106 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Usage",
"CA1801:ReviewUnusedParameters", MessageId =
"criteria")]
107 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1822:MarkMembersAsStatic")]
108 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Performance",
"CA1811:AvoidUncalledPrivateCode")]
110 private void DataPortal_Delete(
object criteria)
120 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Naming",
"CA1707:IdentifiersShouldNotContainUnderscores", MessageId =
"Member")]
121 [EditorBrowsable(EditorBrowsableState.Advanced)]
132 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Naming",
"CA1707:IdentifiersShouldNotContainUnderscores", MessageId =
"Member")]
133 [EditorBrowsable(EditorBrowsableState.Advanced)]
145 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Naming",
"CA1707:IdentifiersShouldNotContainUnderscores", MessageId =
"Member")]
146 [EditorBrowsable(EditorBrowsableState.Advanced)]
154 #region IDataPortalTarget Members
156 void IDataPortalTarget.CheckRules()
159 void IDataPortalTarget.MarkAsChild()
162 void IDataPortalTarget.MarkNew()
165 void IDataPortalTarget.MarkOld()
168 void IDataPortalTarget.DataPortal_OnDataPortalInvoke(DataPortalEventArgs e)
173 void IDataPortalTarget.DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e)
178 void IDataPortalTarget.DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex)
183 void IDataPortalTarget.Child_OnDataPortalInvoke(DataPortalEventArgs e)
186 void IDataPortalTarget.Child_OnDataPortalInvokeComplete(DataPortalEventArgs e)
189 void IDataPortalTarget.Child_OnDataPortalException(DataPortalEventArgs e, Exception ex)
196 object ICloneable.Clone()
207 [EditorBrowsable(EditorBrowsableState.Advanced)]
210 return ObjectCloner.Clone(
this);
226 #region Register Properties
243 return Core.FieldManager.PropertyInfoManager.RegisterProperty<P>(typeof(T), info);
267 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
282 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
310 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
337 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
353 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
383 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
414 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
420 #region IManageProperties Members
422 bool IManageProperties.HasManagedProperties
427 List<IPropertyInfo> IManageProperties.GetManagedProperties()
432 object IManageProperties.GetProperty(
IPropertyInfo propertyInfo)
434 return ReadProperty(propertyInfo);
437 object IManageProperties.ReadProperty(
IPropertyInfo propertyInfo)
439 return ReadProperty(propertyInfo);
442 P IManageProperties.ReadProperty<P>(PropertyInfo<P> propertyInfo)
444 return ReadProperty<P>(propertyInfo);
447 void IManageProperties.SetProperty(
IPropertyInfo propertyInfo,
object newValue)
452 void IManageProperties.LoadProperty(
IPropertyInfo propertyInfo,
object newValue)
454 LoadProperty(propertyInfo, newValue);
457 void IManageProperties.LoadProperty<P>(PropertyInfo<P> propertyInfo, P newValue)
459 LoadProperty<P>(propertyInfo, newValue);
462 bool IManageProperties.LoadPropertyMarkDirty(
IPropertyInfo propertyInfo,
object newValue)
464 LoadProperty(propertyInfo, newValue);
468 List<object> IManageProperties.GetChildren()
473 bool IManageProperties.FieldExists(Core.IPropertyInfo property)
478 object IManageProperties.LazyGetProperty<P>(PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
480 throw new NotImplementedException();
483 object IManageProperties.LazyGetPropertyAsync<P>(PropertyInfo<P> propertyInfo, Task<P> factory)
485 throw new NotImplementedException();
488 P IManageProperties.LazyReadProperty<P>(PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
490 throw new NotImplementedException();
493 P IManageProperties.LazyReadPropertyAsync<P>(PropertyInfo<P> propertyInfo, Task<P> factory)
495 throw new NotImplementedException();
This is the base class from which command objects will be derived.
CommandBase()
Creates an instance of the object.
static PropertyInfo< P > RegisterProperty< P >(PropertyInfo< P > info)
Indicates that the specified property belongs to the business object type.
virtual void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e)
Called by the server-side DataPortal after calling the requested DataPortal_xyz method.
T Clone()
Creates a clone of the object.
virtual void DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex)
Called by the server-side DataPortal if an exception occurs during server-side processing.
virtual void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e)
Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method.
virtual void Initialize()
Override this method to set up event handlers so user code in a partial class can respond to events r...
virtual object GetClone()
Creates a clone of the object.
Base class for an object that is serializable using SerializationFormatterFactory....
FieldDataManager FieldManager
Gets a reference to the field mananger for this object.
Provides information about the DataPortal call.
A strongly-typed resource class, for looking up localized strings, etc.
static string CreateNotSupportedException
Looks up a localized string similar to Invalid operation - create not allowed.
static string FetchNotSupportedException
Looks up a localized string similar to Invalid operation - fetch not allowed.
static string DeleteNotSupportedException
Looks up a localized string similar to Invalid operation - delete not allowed.
static string UpdateNotSupportedException
Looks up a localized string similar to Invalid operation - update not allowed.
Maintains metadata about a property.
string Name
Gets the property name value.
This is the core interface implemented by all CSLA .NET base classes.
int Identity
Gets a value representing this object instance's unique identity value within the business object gra...
This interface is implemented by all Command objects.
Maintains metadata about a property.
This is the base class from which command objects will be derived.
RelationshipTypes
List of valid relationship types between a parent object and another object through a managed propert...
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Delete
Delete operation.