public async Task <IActionResult> Search(SocietySearchViewModel societySearchViewModel)
        {
            societySearchViewModel.VSocietyInfoEntities =
                await _societyServices.SearchSocieties(societySearchViewModel);

            societySearchViewModel.SocietyCategoryEntities = await _societyServices.GetSocietyCategoriesAsync();

            return(View(societySearchViewModel));
        }
        public async Task <IActionResult> Search()
        {
            SocietySearchViewModel societySearchViewModel = new SocietySearchViewModel
            {
                SocietyCategoryEntities = await _societyServices.GetSocietyCategoriesAsync(),
                VSocietyInfoEntities    = new List <VSocietyInfoEntity>()
            };

            return(View(societySearchViewModel));
        }
        public async Task <List <VSocietyInfoEntity> > SearchSocieties(SocietySearchViewModel societySearchViewModel)
        {
            if (societySearchViewModel.NameContains == null)
            {
                societySearchViewModel.NameContains = "";
            }
            if (societySearchViewModel.DescriptionContains == null)
            {
                societySearchViewModel.DescriptionContains = "";
            }

            if (societySearchViewModel.SelectedCategory == null)
            {
                return(await _societyManagementSystemDbContext.VSocietyInfo
                       .FindByNameContainsAndDescriptionContainsAndStatusIsActiveAsync(societySearchViewModel.NameContains,
                                                                                       societySearchViewModel.DescriptionContains));
            }
            return(await _societyManagementSystemDbContext.VSocietyInfo
                   .FindByNameContainsAndCategoryIdAndDescriptionContainsAndStatusIsActiveAsync(
                       societySearchViewModel.NameContains,
                       (int)societySearchViewModel.SelectedCategory, societySearchViewModel.DescriptionContains));
        }