public async Task <ResponseMessage> DeleteHomepass(string homepassId)
        {
            try
            {
                //var searchFilter = new SearchFilter
                //{
                //    Filters = new List<Filter> {
                //        new Filter {
                //            PropertyName = "Homepasses", Operator = Operator.Equals, Value = homepassId
                //        }
                //    }
                //};

                //var usersCount = await _homepassService.GetUsersCount(searchFilter);

                //if (usersCount == 0)
                //{
                var status = await _homepassService.DeleteHomepass(homepassId);

                return(new ResponseMessage {
                    Status = "Ok", Data = status
                });
                //}
                //else
                //    return new ResponseMessage { Status = "Error", Message = "HomePass cannot be deleted as there are users associated with the selected homepass." };
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex, "Error deleting homepass.");
                return(new ResponseMessage {
                    Status = "Error", Message = "Error deleting homepass."
                });
            }
        }
        public async Task <ResponseMessage> DeleteHomepass(string homepassId)
        {
            try
            {
                var status = await _homepassService.DeleteHomepass(homepassId);

                return(new ResponseMessage {
                    Status = "Ok", Data = status
                });
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex, "Error deleting homepass.");
                return(new ResponseMessage {
                    Status = "Error", Message = "Error deleting homepass."
                });
            }
        }