Пример #1
0
        // Add Borrower
        public Borrower AddBorrower(Borrower borrower)
        {
            try
            {
                ValidateBorrower(borrower);
                long id = 0;

                var borrowerToAdd = new Borrower
                {
                    Id        = _redisCacheProvider.GetNextSequenceForBorrower(),
                    FirstName = borrower.FirstName,
                    LastName  = borrower.LastName
                };

                _redisCacheProvider.SaveBorrower(borrowerToAdd);

                id = borrowerToAdd.Id;

                // Get the borrower details that has been inserted
                var borrowerInserted = _redisCacheProvider.GetBorrowerById(id);
                return(borrowerInserted);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }