Пример #1
0
        public async Task DeleteUserInfo(int id)
        {
            var deleted = await SelectById(id);

            if (deleted != null)
            {
                _db.Set <UserInfo>().Remove(deleted);
            }
            else
            {
                throw new ArgumentException("Not found object id.");
            }
            await SaveUserInfo();
        }
        public async Task DeleteOrder(int id)
        {
            var deleted = await GetOrderById(id);

            if (deleted != null)
            {
                _db.Set <Order>().Remove(deleted);
            }
            else
            {
                throw new ArgumentException("Not found object id.");
            }
            await SaveOrder();
        }
Пример #3
0
 public async Task <IEnumerable <OrderDetail> > SelectAll(Expression <Func <OrderDetail, bool> > predicate)
 {
     return(await _db.Set <OrderDetail>().Where(predicate).ToListAsync());
 }