//get filtered data list
        public IList <SHARED.ViewModals.Task> getFilteredTasks(string filter)
        {
            IList <TodoModel> filteredDataList;

            switch (filter)
            {
            case "IsCompleted":
                filteredDataList = _context.TodoModels.Where(s => s.IsCompleted == 1)
                                   .ToList();
                break;

            case "IsExpired":
                filteredDataList = _context.TodoModels.Where(q => q.IsExpired == 1).ToList();
                break;

            case "IsDeleted":
                filteredDataList = _context.TodoModels.Where(q => q.IsDeleted == 1).ToList();
                break;

            case "IsOnGoing":
                filteredDataList = _context.TodoModels.Where(q => q.IsExpired == 0 && q.IsDeleted == 0 && q.IsCompleted == 0).ToList();
                break;

            default:
                filteredDataList = _context.TodoModels.ToList();
                break;
            }

            return(EntityDTOConversion.EntityToDTO(filteredDataList));
        }
        //get pagination TaskList
        public IEnumerable <SHARED.ViewModals.Task> getPagination(int?pageNumber, int?pageSize)
        {
            IEnumerable <SHARED.ViewModals.Task> Tasks = EntityDTOConversion.EntityToDTO(_context.TodoModels.ToList());
            var currentPageNumber = pageNumber ?? 1;
            var currentPageSize   = pageSize ?? 5;

            return(Tasks.Skip((currentPageNumber - 1) * currentPageSize).Take(currentPageSize));
        }
        //get sorted data list
        public IList <SHARED.ViewModals.Task> getSortedTasks(string sort)
        {
            IList <TodoModel> sortedTaskList;

            switch (sort)
            {
            case "desc":
                sortedTaskList = _context.TodoModels.OrderByDescending(q => q.Title).ToList();
                break;

            case "asc":
                sortedTaskList = _context.TodoModels.OrderBy(q => q.Title).ToList();
                break;

            default:
                sortedTaskList = _context.TodoModels.ToList();
                break;
            }
            return(EntityDTOConversion.EntityToDTO(sortedTaskList));
        }
        //returns list of all tasks
        public IList <SHARED.ViewModals.Task> getTasks()
        {
            IList <TodoModel> tasks = _context.TodoModels.ToList();

            return(EntityDTOConversion.EntityToDTO(tasks));
        }
        //get Search Result
        public IEnumerable <SHARED.ViewModals.Task> getSearchResult(string searchString)
        {
            IEnumerable <SHARED.ViewModals.Task> searchList = EntityDTOConversion.EntityToDTO(_context.TodoModels.Where(q => q.Title.Contains(searchString)).ToList());

            return(searchList);
        }