public CreateFdResponse CreateFd(CreateFDRequest requestModel) { CreateFdResponse response = null; if (requestModel != null) { try { response = FDAccess.Insert(new FixedDeposite() { Amount = requestModel.Amount, DateFoCreation = requestModel.DateFoCreation, FIName = requestModel.FIName, InterestRate = requestModel.InterestRate, MaturityAmount = requestModel.MaturityAmount, StartDate = requestModel.StartDate, NameOfOwner = requestModel.NameOfOwner, MaturityDate = requestModel.MaturityDate, NameOfHolder = requestModel.NameOfFirstHolder, NameOfNominee = requestModel.NameOfNominee, FdId = requestModel.FdId }); } catch (Exception ex) { throw new Exception(ex.Message); //log ex } } return(response); }
public IHttpActionResult CreateFD([FromBody] CreateFDRequest fd) { var response = ifdOperations.CreateFd(fd); if (response == null) { throw new NullReferenceException("Null reference occured while creating FD"); } return(Ok(response)); }