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)]
226 #region Register Properties
243 return Core.FieldManager.PropertyInfoManager.RegisterProperty<P>(typeof(T), info);
267 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
294 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
321 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
350 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
381 PropertyInfo reflectedPropertyInfo = Reflect<T>.GetProperty(propertyLambdaExpression);
387 #region IManageProperties Members
389 bool IManageProperties.HasManagedProperties
394 List<IPropertyInfo> IManageProperties.GetManagedProperties()
399 object IManageProperties.GetProperty(
IPropertyInfo propertyInfo)
401 return ReadProperty(propertyInfo);
404 object IManageProperties.ReadProperty(
IPropertyInfo propertyInfo)
406 return ReadProperty(propertyInfo);
409 P IManageProperties.ReadProperty<P>(PropertyInfo<P> propertyInfo)
411 return ReadProperty<P>(propertyInfo);
414 void IManageProperties.SetProperty(
IPropertyInfo propertyInfo,
object newValue)
419 void IManageProperties.LoadProperty(
IPropertyInfo propertyInfo,
object newValue)
421 LoadProperty(propertyInfo, newValue);
424 void IManageProperties.LoadProperty<P>(PropertyInfo<P> propertyInfo, P newValue)
426 LoadProperty<P>(propertyInfo, newValue);
429 bool IManageProperties.LoadPropertyMarkDirty(
IPropertyInfo propertyInfo,
object newValue)
431 LoadProperty(propertyInfo, newValue);
435 List<object> IManageProperties.GetChildren()
440 bool IManageProperties.FieldExists(Core.IPropertyInfo property)
445 object IManageProperties.LazyGetProperty<P>(PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
447 throw new NotImplementedException();
450 object IManageProperties.LazyGetPropertyAsync<P>(PropertyInfo<P> propertyInfo, Task<P> factory)
452 throw new NotImplementedException();
455 P IManageProperties.LazyReadProperty<P>(PropertyInfo<P> propertyInfo, Func<P> valueGenerator)
457 throw new NotImplementedException();
460 P IManageProperties.LazyReadPropertyAsync<P>(PropertyInfo<P> propertyInfo, Task<P> factory)
462 throw new NotImplementedException();
Provides consistent context information between the client and server DataPortal objects.
This is the base class from which command objects will be derived.
CommandBase()
Creates an instance of the type.
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.