コード例 #1
0
 private static Core.Model.CoreLoan MapLoan(Model.Loan loan)
 {
     return(loan is null ? null : new Core.Model.CoreLoan
     {
         Id = loan.Id,
         AccumulatedCost = loan.AccumulatedCost,
         RetainingCost = loan.RetainingCost,
         InterestRate = loan.InterestRate,
         MonthlyRate = loan.MonthlyRate,
         UserId = loan.UserId,
         //CurrentUser = MapUsers(loan.User)
     });
 }
コード例 #2
0
        public async Task <bool> RemoveLoanAsync(int id)
        {
            Model.Loan Loan = await _context.Loan.FindAsync(id);

            if (Loan is null)
            {
                return(false);
            }

            _context.Remove(Loan);

            int written = await _context.SaveChangesAsync();

            return(written > 0);
        }