Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8474505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:38:41+00:00 2026-06-10T17:38:41+00:00

I’ve been following the Tasky Case Study on the MonoDroid website, but I’ve run

  • 0

I’ve been following the Tasky Case Study on the MonoDroid website, but I’ve run into a wall whilst creating a filtering and ordering query. I was wondering if somebody could explain where I might be going wrong please? I’m probably doing something completely backwards!

I get the error:

The type arguments for method ‘ICanTalk.BusinessLayer.Services.WordServices.Find(System.Func, System.Func, bool, int, int)’ cannot be inferred from the usage. Try specifying the type arguments explicitly.

I have the following code in one of my repositories, hopefully what I’m trying to do is kind of clear. I haven’t been able to build it yet to test to see if it works though:

  public static IEnumerable<Word> Find<T,U>(Func<Word, bool> whereClause, Func<Word,U> orderBy, bool ascending, int show, int page)
  {
      int currentPage = page;
      int resultsPerPage = show;
      int skip = currentPage*show;

      var result = ascending
                       ? me.db.Find<Word>().Where(whereClause).OrderBy(orderBy).Take(resultsPerPage).Skip(skip)
                       : me.db.Find<Word>().Where(whereClause).OrderByDescending(orderBy).Take(resultsPerPage).Skip(skip);

      return result;

  }

From my services I call this method from here:

  public static IList<Word> Find<T>(Func<Word, bool> whereClause, Func<Word,DateTime> orderBy, bool ascending, int show, int page)
  {
      return WordRepository.Find<Word, DateTime>(whereClause, orderBy, ascending, show, page).ToList();
  }

What I’m trying to achieve is a call from an event handler within MonoDroid like:

 var wordTest = WordServices.Find(x => x.ChildId == 3, x => x.AddedAt, true, 5, 1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:38:43+00:00Added an answer on June 10, 2026 at 5:38 pm

    I had it almost right, I stripped it down to the basics and worked my way back up and came up with the following (compare to original if you’re interested).

    SQLiteDatabase.cs

    (not in original post – I scaled the query clauses right down to a reusable method in my generic handler):

       public IEnumerable<T> Find<T>(Func<T, bool> whereClause, int resultsToSkip, int resultsToShow)
              where T : BusinessLayer.Contracts.IBusinessEntity, new()
        {
            lock (locker)
            {
                return Table<T>().Where(whereClause).Skip(resultsToSkip).Take(resultsToShow).ToList();
            }
        }
    

    WordRepository.cs

        public static IEnumerable<Word> Find<T>(Func<Word, bool> whereClause, int resultsToSkip, int resultsToShow)
            where T : BusinessLayer.Contracts.IBusinessEntity, new()
        {
            var result = me.db.Find<Word>(whereClause, resultsToSkip, resultsToShow);
    
            return result;
        }
    

    WordServices.cs

    By this point I’m wondering why there exists a need for so many layers – will definitley look to refactor in the morning.

        public static IList<Word> Find<T, U>(Func<Word, bool> whereClause, Func<Word, U> orderBy, bool ascending,  int show, int page)
        {
            int resultsToShow = show;
            int resultsToSkip = show * (page - 1);
    
            var result = ascending ? WordRepository.Find<Word>(whereClause, resultsToSkip, resultsToShow).OrderBy(orderBy)
                                   : WordRepository.Find<Word>(whereClause, resultsToSkip, resultsToShow).OrderByDescending(orderBy);
    
            return result.ToList();
        }
    

    Originating Call

       var wordTest1 = WordServices.Find<Word, DateTime>(x => x.ChildId == 1, x => x.AddedAt, true, 5, 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.