public async Task <bool> AddUpdateCreditClassificationAsync(credit_creditclassification model)
        {
            try
            {
                if (model.CreditClassificationId > 0)
                {
                    var itemToUpdate = await _dataContext.credit_creditclassification.FindAsync(model.CreditClassificationId);

                    _dataContext.Entry(itemToUpdate).CurrentValues.SetValues(model);
                }
                else
                {
                    await _dataContext.credit_creditclassification.AddAsync(model);
                }
                return(await _dataContext.SaveChangesAsync() > 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <ActionResult <CreditClassificationRegRespObj> > AddUpDateAccountType([FromBody] AddUpdateCreditClassification model)
        {
            try
            {
                credit_creditclassification item = null;
                if (model.CreditClassificationId > 0)
                {
                    item = await _repo.GetCreditClassificationByIdAsync(model.CreditClassificationId);

                    if (item == null)
                    {
                        return new CreditClassificationRegRespObj
                               {
                                   Status = new APIResponseStatus {
                                       IsSuccessful = false, Message = new APIResponseMessage {
                                           FriendlyMessage = "Item does not Exist"
                                       }
                                   }
                               }
                    }
                    ;
                }

                var domainObj = new credit_creditclassification();
                domainObj.CreditClassificationId  = model.CreditClassificationId > 0 ? model.CreditClassificationId : 0;
                domainObj.Description             = model.Description;
                domainObj.ProvisioningRequirement = model.ProvisioningRequirement;
                domainObj.UpperLimit = model.UpperLimit;
                domainObj.LowerLimit = model.LowerLimit;
                domainObj.Active     = true;
                domainObj.CreatedBy  = string.Empty;
                domainObj.CreatedOn  = DateTime.Today;
                domainObj.Deleted    = false;
                domainObj.UpdatedBy  = string.Empty;
                domainObj.UpdatedOn  = model.CreditClassificationId > 0 ? DateTime.Today : DateTime.Today;

                var isDone = await _repo.AddUpdateCreditClassificationAsync(domainObj);

                return(new CreditClassificationRegRespObj
                {
                    CreditClassificationId = domainObj.CreditClassificationId,
                    Status = new APIResponseStatus {
                        IsSuccessful = isDone ? true : false, Message = new APIResponseMessage {
                            FriendlyMessage = isDone ? "successful" : "Unsuccessful"
                        }
                    }
                });
            }
            catch (Exception ex)
            {
                var errorCode = ErrorID.Generate(5);
                return(new CreditClassificationRegRespObj
                {
                    Status = new APIResponseStatus {
                        IsSuccessful = false, Message = new APIResponseMessage {
                            FriendlyMessage = "Error Occurred", TechnicalMessage = ex?.Message, MessageId = errorCode
                        }
                    }
                });
            }
        }