IDetailTracker<TModel> Interface
.NET Standard 2.x
Represents an object that can track data for the detail model after the ISqlModelMapper.TrackMaster method is called.
It is used when working with the master-detail models where the ModelEmbedded attribute is applied in a property of the master model.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public interface IDetailTracker<TModel>;
Properties
Name |
Return Type |
Description |
MasterModel |
TModel |
Gets a reference to an internal TModel instance where the data is cached when the ISqlModelMapper.TrackMaster method is called. |
Methods
Name |
Return Type |
Description |
SaveChanges() |
IDbResult |
Updates the database by executing the data changes tracked by a SqlModelMapper instance. |
TrackDetail<TDetailModel>(Expression<Func<TModel, object>> propertyExpr, IModelEntry<TDetailModel> modelEntry) |
IDetailTracker<TModel> |
Tracks an operation on the detail table for the master-detail models. |
TrackGrandDetail<TDetailModel, TGrandDetailModel>(Expression<Func<TModel, object>> propertyExpr, IModelEntry<TDetailModel> modelEntry, Expression<Func<TDetailModel, object>> detailPropertyExpr, IModelEntry<TGrandDetailModel> grandModelEntry) |
IDetailTracker<TModel> |
Tracks an operation on the detail table and on the granddetail table for the master-detail-granddetail models. |
TrackGrandDetails<TDetailModel, TGrandDetailModel>(Expression<Func<TModel, object>> propertyExpr, IModelEntry<TDetailModel> modelEntry, Expression<Func<TDetailModel, object>> detailPropertyExpr, IEnumerable<IModelEntry<TGrandDetailModel>> grandModelEntries) |
IDetailTracker<TModel> |
Tracks an operation on the detail table and one or more operations on the granddetail table for the master-detail-granddetail models. |
TrackDetails<TDetailModel>(Expression<Func<TModel, object>> propertyExpr, IEnumerable<IModelEntry<TDetailModel>> modelEntry) |
IDetailTracker<TModel> |
Tracks one or more operations on the detail table for the master-detail models. |
An IDetailTracker
object provides a series of methods. Using these methods together with the ISqlModelMapper.TrackMaster method can easily track and save data in the models with complex multi-level relationship such as master-detail or master-detail-granddetail. The IDetailTracker
object currently supports up to three levels of master-detail relationships (master-detail-granddetail).