Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Func<> Question

Func<> Question

Scheduled Pinned Locked Moved C#
helpquestionwpf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I have a repository method:

    public static List GetNavigationItems(NavigationItemType itemType)
    {
    var results = new List();

    return results;
    

    }

    I want to calll it using a Func<>

    Func,NavigationItemType> method = Repository.GetNavigationItems(NavigationItemType.Company);

    But I'm getting this compilation error:

    Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Func>' Navigation C:\Users\kevin\source\repos\NavigationControl\Navigation\MainWindow.xaml.cs 34 Active

    What am I doing wrong here?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups