public override void Commit(CommitTypeEnum commitType, DMSource model, int id = 0) { var accessor = DC.Accessor <DMSource>(); switch (commitType) { case CommitTypeEnum.ADD: RunChildAdd(accessor, model); break; case CommitTypeEnum.REMOVE: Delete(accessor, model.ID); break; case CommitTypeEnum.UPDATE: Update(accessor, id, model); break; case CommitTypeEnum.PATCH: RunChildPatch(accessor, model); break; default: break; } accessor.Dispose(); NotifyChangeListeners(); }
private List <DMSource> GetByConnection(ConnectionDM connection) { var accessor = DC.Accessor <DMSource>(); var result = GetAll(accessor, (item) => item.ID == connection.ChildID); accessor.Dispose(); NotifyChangeListeners(); return(result); }
public override List <DMSource> PullAll(Expression <Func <DMSource, bool> > filter, bool WithDetails = false) { var accessor = DC.Accessor <DMSource>(); List <DMSource> result = GetAll(accessor, filter); accessor.Dispose(); NotifyChangeListeners(); return(result); }
public override List <DMSource> PullAll(bool WithDetails = false) { var accessor = DC.Accessor <DMSource>(); var result = GetAll(accessor, null); accessor.Dispose(); NotifyChangeListeners(); return(result); }
public override DMSource Pull(Expression <Func <DMSource, bool> > filter, bool WithDetails = false) { var accessor = DC.Accessor <DMSource>(); var result = Get(accessor, filter); if (WithDetails) { PopulateDetails(accessor, result); } accessor.Dispose(); NotifyChangeListeners(); return(result); }
public override List <DMSource> PullAll(Expression <Func <DMSource, bool> > filter, bool WithDetails = false) { var accessor = DC.Accessor <DMSource>(); List <DMSource> result = GetAll(accessor, filter); if (WithDetails) { result.ForEach(model => { PopulateDetails(accessor, model); }); } accessor.Dispose(); NotifyChangeListeners(); return(result); }
public override List <DMSource> PullAll(bool WithDetails = false) { var accessor = DC.Accessor <DMSource>(); var result = GetAll(accessor, null); if (WithDetails) { result.ForEach(model => { PopulateDetails(accessor, model); }); } accessor.Dispose(); NotifyChangeListeners(); return(result); }