private void CheckCount()
    {
        TaskDb db = new TaskDb();

        _count = db.GetCount();
        db.Close();
    }
    private void InitTasks()
    {
        TaskDb db = new TaskDb();

        availableTasksIds = db.GetAllIds();
        db.Close();
        usedTasksIds = new List <int>();
    }
    public static TaskEntity GetDataById(int id)
    {
        TaskDb     db   = new TaskDb();
        TaskEntity task = db.GetEntityById(id);

        db.Close();
        return(task);
    }
    private List <int> FilterByLessLevelIn(List <int> idsIn)
    {
        TaskDb     db          = new TaskDb();
        List <int> idsForLevel = db.GetIdsForLessLevel(GameProgress.Level);

        db.Close();
        List <int> result = idsIn.Intersect(idsForLevel).ToList(); //probably better to filter in sql query

        return(result);
    }