public async Task <IActionResult> updateMerchantDetails(MerchantDto MerchantDto)
        {
            try
            {
                strMerchantImages = _configuration["FilePath:ImagePath"] + "MerchantImages/";
                if (!String.IsNullOrEmpty(MerchantDto.ProfileImage))
                {
                    if (MerchantDto.ProfileImage.Substring(MerchantDto.ProfileImage.Length - 3) != "jpg")
                    {
                        if (!String.IsNullOrEmpty(MerchantDto.ProfileImage))
                        {
                            if (!Directory.Exists(strMerchantImages))
                            {
                                Directory.CreateDirectory(strMerchantImages);
                            }
                            Byte[] imageByteData = Convert.FromBase64String(MerchantDto.ProfileImage);
                            var    fs            = new BinaryWriter(new FileStream(strMerchantImages + ProfileImage + ".jpg", FileMode.Create, FileAccess.Write));
                            fs.Write(imageByteData);
                            fs.Close();
                            MerchantDto.ProfileImage = ProfileImage + ".jpg";
                        }
                    }
                    else
                    {
                        MerchantDto.ProfileImage = "";
                    }
                }
                else
                {
                    MerchantDto.ProfileImage = "";
                }
                if (!String.IsNullOrEmpty(MerchantDto.CompanyImage))
                {
                    if (MerchantDto.CompanyImage.Substring(MerchantDto.CompanyImage.Length - 3) != "jpg")
                    {
                        if (!String.IsNullOrEmpty(MerchantDto.CompanyImage))
                        {
                            if (!Directory.Exists(strMerchantImages))
                            {
                                Directory.CreateDirectory(strMerchantImages);
                            }
                            Byte[] imageByteData = Convert.FromBase64String(MerchantDto.CompanyImage);
                            var    fs            = new BinaryWriter(new FileStream(strMerchantImages + CompanyImage + ".jpg", FileMode.Create, FileAccess.Write));
                            fs.Write(imageByteData);
                            fs.Close();
                            MerchantDto.CompanyImage = CompanyImage + ".jpg";
                        }
                    }
                    else
                    {
                        MerchantDto.CompanyImage = "";
                    }
                }
                else
                {
                    MerchantDto.CompanyImage = "";
                }

                string returnstatus = await _MerchantService.UpdateRegistrationDetails(MerchantDto);

                if (returnstatus == "Success")
                {
                    return(Ok(new GenericResultDto <string> {
                        Result = "Merchant updated successfully", ReFirstName = MerchantDto.Name, ReEmail = MerchantDto.Email
                    }));
                }
                else
                {
                    return(BadRequest(new GenericResultDto <string> {
                        Result = "You cannot uncheck categories which are having the catalog"
                    }));
                }
            }

            catch (Exception err)
            {
                return(BadRequest(new GenericResultDto <string> {
                    Result = err.Message
                }));
            }
        }