MongoServices 0.2.0
A Service/Repository Framework for mongoDB
|
The base "Read/Write" service. More...
Public Member Functions | |
ReadWriteService (IReadWriteRepository< T > readWriteRepository) | |
Constructs a ReadWriteService based on the readWriteRepository parameter. | |
SaveResult | Save (T model) |
Saves the MongoServicesModel. | |
IDictionary < MongoServicesModel, SaveResult > | Save (IEnumerable< T > models) |
Saves a collection of MongoServicesModels. | |
void | DeleteById (ObjectId id) |
Deleted one document from the mongoDB collection. | |
Static Public Member Functions | |
static void | AddBeforeSaveProcess (Func< T, bool > process) |
Adds a process that will occur before any save that happens through this service. | |
static void | ClearBeforeSaveProcesses () |
Removes all of the before save processes. | |
static void | AddAfterSaveProcess (Action< T > process) |
Adds a process that will occur after any save that happens through this service. | |
static void | ClearAfterSaveProcesses () |
Removes all of the after save processes. | |
Properties | |
IReadWriteRepository< T > | ReadWriteRepository [get, set] |
Gets the IReadWriteRepository<T> that was passed into the constructor. |
The base "Read/Write" service.
T | The MongoServices model to be used by this service. |
T | : | MongoServicesModel |
Definition at line 14 of file ReadWriteService.cs.
static void MongoServices.ReadWriteService< T >.AddAfterSaveProcess | ( | Action< T > | process | ) | [static] |
Adds a process that will occur after any save that happens through this service.
process | The after save process to add. |
Definition at line 132 of file ReadWriteService.cs.
static void MongoServices.ReadWriteService< T >.AddBeforeSaveProcess | ( | Func< T, bool > | process | ) | [static] |
Adds a process that will occur before any save that happens through this service.
process | The before save process to add. |
Definition at line 115 of file ReadWriteService.cs.
static void MongoServices.ReadWriteService< T >.ClearAfterSaveProcesses | ( | ) | [static] |
Removes all of the after save processes.
Definition at line 140 of file ReadWriteService.cs.
static void MongoServices.ReadWriteService< T >.ClearBeforeSaveProcesses | ( | ) | [static] |
Removes all of the before save processes.
Definition at line 123 of file ReadWriteService.cs.
void MongoServices.ReadWriteService< T >.DeleteById | ( | ObjectId | id | ) |
Deleted one document from the mongoDB collection.
id | The "Id" of the document to be deleted. |
Implements MongoServices.IReadWriteService< T >.
Definition at line 104 of file ReadWriteService.cs.
MongoServices.ReadWriteService< T >.ReadWriteService | ( | IReadWriteRepository< T > | readWriteRepository | ) |
Constructs a ReadWriteService based on the readWriteRepository
parameter.
readWriteRepository | The IReadWriteRepository<T> to be used with this service. |
Definition at line 29 of file ReadWriteService.cs.
IDictionary<MongoServicesModel, SaveResult> MongoServices.ReadWriteService< T >.Save | ( | IEnumerable< T > | models | ) |
Saves a collection of MongoServicesModels.
models | The collection of MongoServicesModels to be saved. |
/
Implements MongoServices.IReadWriteService< T >.
Definition at line 88 of file ReadWriteService.cs.
SaveResult MongoServices.ReadWriteService< T >.Save | ( | T | model | ) |
Saves the MongoServicesModel.
model | The MongoServicesModel to be saved. |
Implements MongoServices.IReadWriteService< T >.
Definition at line 68 of file ReadWriteService.cs.
IReadWriteRepository<T> MongoServices.ReadWriteService< T >.ReadWriteRepository [get, set, protected] |
Gets the IReadWriteRepository<T> that was passed into the constructor.
Definition at line 21 of file ReadWriteService.cs.