コード例 #1
0
        public Account Delete(int id)
        {
            var account = context.Accounts.FirstOrDefault(x => x.Id == id);

            if (account == null)
            {
                return(null);
            }
            context.Remove(account);
            context.SaveChanges();
            return(account);
        }
コード例 #2
0
        public Trade Delete(int id)
        {
            var trade = context.Trades.FirstOrDefault(x => x.Id == id);

            if (trade == null)
            {
                return(null);
            }
            context.Remove(trade);
            context.SaveChanges();
            return(trade);
        }