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) }); }
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); }