Assume: Operations work best and efficiently when tables have a TimeStamp field
Each business object maps to a primary Entity/Table, but can of course access other tables.
public abstract class BusinessObjectLinq<TEntity,TContext> : object, IDisposable
Member | Description | |
---|---|---|
Constructor | Base constructor - initializes the business object's context and table mapping info | |
ProviderFactory | The provider factory used for direct ADO.NET operations | |
AbortChanges | Cancel Changes on the current connected context public virtual void AbortChanges();
|
|
CancelChanges | Aborts all changes made to tracked entities. public void CancelChanges();
|
|
Delete | Deletes an entity specific by its Pk public virtual bool Delete(object Pk);
public bool Delete();
public virtual bool Delete(TEntity entity);
|
|
Dispose | public sealed void Dispose();
|
|
GetProperties | public bool GetProperties(string stringFieldNameToLoadFrom);
|
|
Load | Loads an individual instance of an object and returns the instance. Entity is also set with the entity if loaded. public virtual TEntity Load(object pk);
public virtual TEntity Load(int pk);
public virtual TEntity Load(string pk);
public virtual TEntity Load(Expression<Func`2> whereClauseLambda);
|
|
NewEntity | Create a new entity instance. When in connected mode the instance is automatically added to the context unless you pass false to the constructor. public virtual TEntity NewEntity(bool noContextInsert);
public virtual TEntity NewEntity();
|
|
Save | Saves a disconnected entity object public virtual bool Save(TEntity entity);
public virtual bool Save();
|
|
SetError | Sets an internal error message. public void SetError(string Message);
public void SetError(Exception ex);
public void SetError();
|
|
SetProperties | Saves the Properties Dictionary to a specified field value public void SetProperties(string stringFieldToSaveTo);
|
|
SubmitChanges | Saves changes on the current connected context. Preferrably you should use Save() rather than this method, but this provides a more low level direct context saving approach if you are working with connected data. public bool SubmitChanges(ConflictResolutionModes ConflictResolutionMode);
public bool SubmitChanges();
|
|
Validate | Validate() is used to validate business rules on the business object. Generally this method consists of a bunch of if statements that validate the data of the business object and adds any errors to the wwBusiness.ValidationErrors collection. public bool Validate(TEntity entity);
public virtual bool Validate();
|
|
Context | Instance of the Data Context that is used for this class. Note that this is a primary instance only - other instances can be used in other situations. | |
Converter | Object that handles conversion of queries into concreate types and data structures. Allows conversion of queries to a data reader, data table as well as the standard behaviors ToList(), ToArray() using the entity class as its input. | |
Entity | Instance of a locally managed entity object. Set with Load and New methods. | |
ErrorException | Instance of an exception object that caused the last error | |
ErrorMessage | Error Message of the last exception | |
Options | Contains options for the business object's operation | |
Properties | ||
TableInfo | Contains information about the primary table that is mapped to this business object. Contains table name, Pk and version field info. | |
ValidationErrors | A collection that can be used to hold errors. This collection is set by the AddValidationError method. |