List <Delivery> IDeliveryService.RefreshAll() { List <Delivery> deliveries = _remoteHandler.GetAll(); if (deliveries != null && deliveries.Count > 0) { _dbHandler.DeleteAll(); _dbHandler.Add(deliveries); } return(deliveries); }
public bool SaveActivity(BGActivity bGActivity) { int rowsEffected = -1; using (_dbHandler = SADFactory.GetDBHandler <BGActivity>()) { var existingActivitys = _dbHandler.GetAll(a => a.TargetObjectId == bGActivity.TargetObjectId); if (existingActivitys.Count > 0) { var existingActivity = existingActivitys.First(); _dbHandler.DeleteItem(existingActivity.ActivityId); } rowsEffected = _dbHandler.Add(bGActivity); } return(rowsEffected != -1); }
public static IEnumerable <Record> DBAdd(this IEnumerable <Record> items, IDBHandler handler, Action <IEnumerable <Record> > action, int bulkCount = 10000) => handler.Add(items, action, bulkCount);
public static IEnumerable <T> DBAdd <T>(this IEnumerable <T> items, IDBHandler handler, int bulkCount = 10000) where T : IEntity => handler.Add(items, bulkCount);
public void Add(T item) => Handler.Add(item);