public async Task CreateApplicationAsync(CreateOrEditApplicationDto newApplication)
        {
            if (await _applicationRepository.GetAll().AnyAsync(x => x.ApplicationName.Trim().ToLower().Equals(newApplication.ApplicationName.Trim().ToLower())))
            {
                throw new UserFriendlyException(L(AppConsts.ApplicationIsAlreadyExist));
            }

            var   application = ObjectMapper.Map <CETAutomation.Masters.Application>(newApplication);
            Regex rg          = new Regex(AppConsts.AlphanumericRegex);
            Regex rgVp        = new Regex(AppConsts.DecimalRegex);
            var   isMatch     = rg.IsMatch(newApplication.ApplicationName);



            if (isMatch)
            {
                application.CreationTime = Clock.Now;
                await _applicationRepository.InsertAsync(application);
            }
            else
            {
                if (!isMatch)
                {
                    throw new UserFriendlyException(L(AppConsts.UseOnlyAlphaNumericForApplication));
                }
            }
        }
        public async Task UpdateApplicationAsync(CreateOrEditApplicationDto updatedApplication)
        {
            if (await _applicationRepository.GetAll().AnyAsync(x => x.Id != updatedApplication.Id && x.ApplicationName.Trim().ToLower().Equals(updatedApplication.ApplicationName.Trim().ToLower())))
            {
                throw new UserFriendlyException(L(AppConsts.ApplicationIsAlreadyExist));
            }

            var applicationUpdate = await _applicationRepository.FirstOrDefaultAsync((int)updatedApplication.Id);

            Regex rg      = new Regex(AppConsts.AlphanumericRegex);
            Regex rgVp    = new Regex(AppConsts.DecimalRegex);
            var   isMatch = rg.IsMatch(updatedApplication.ApplicationName);

            if (isMatch)
            {
                ObjectMapper.Map(updatedApplication, applicationUpdate);
            }
            else
            {
                if (!isMatch)
                {
                    throw new UserFriendlyException(L(AppConsts.UseOnlyAlphaNumericForApplication));
                }
            }
        }
 /// <summary>
 /// Method for create or edit application
 /// </summary>
 /// <param name="application">CreateOrEditApplicationDto object</param>
 /// <returns>Task</returns>
 public async Task CreateOrEditAsync(CreateOrEditApplicationDto application)
 {
     if (application.Id == null)
     {
         await CreateApplicationAsync(application);
     }
     else
     {
         await UpdateApplicationAsync(application);
     }
 }