Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kristoffer Lindén 12 posts 122 karma points
    May 23, 2019 @ 19:36
    Kristoffer Lindén
    0

    Get instance of ITaskService?

    Hi!

    How do I get an instance of the ITaskService in a standard Umbraco 7.10 installation? I have a webapi controller where I would like to use ITaskService but I cannot get an instance of the interface no matter how I try.

    Thanks!

    /Kristoffer

  • Kristoffer Lindén 12 posts 122 karma points
    May 28, 2019 @ 19:51
    Kristoffer Lindén
    100

    I found the solution. Make your controller inherit UmbracoApiController

    Then you can use:

    var tasks = base.ApplicationContext.Services.TaskService.GetTasks(taskTypeAlias: "toTranslate");
    

    /Kristoffer

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies