public virtual int BatchInsert(List<Transaction> list, int? companyId, bool intoCache) { var cache = new CacheWrapper(); var res = TransactionsDataAdapter.BatchInsert(list, companyId, DbActionType.Insert); if (res == 0) { //if ok - update cache if (intoCache) { foreach (var entity in list) { cache.AddToList(CacheKey, entity, companyId); } } } return res; }
private int InsertUpdate(Tag entity, int? userId, DbActionType action, bool intoCache) { var cache = new CacheWrapper(); var res = TagsDataAdapter.InsertUpdate(entity, userId, action); if (res == 0) { //if ok - update cache if (intoCache) { if (action == DbActionType.Insert) cache.AddToList(CacheKey, entity, userId); if (action == DbActionType.Update) cache.UpdateList(CacheKey, entity, userId); } } return res; }
private static int InsertUpdate(Account entity, int? companyId, DbActionType action, bool intoCache) { var cache = new CacheWrapper(); var res = AccountsDataAdapter.InsertUpdate(entity, companyId, action); if (res == 0) { //if ok - update cache if (intoCache) { if (action == DbActionType.Insert) cache.AddToList(CacheKey, entity, companyId); if (action == DbActionType.Update) cache.UpdateList(CacheKey, entity, companyId); } } return res; }