# Running Task() that is stored in an object within a ReoccurringJob

**URL:** https://discuss.hangfire.io/t/running-task-that-is-stored-in-an-object-within-a-reoccurringjob/4811
**Category:** question
**Created:** [June 21, 2018, 2:05pm UTC](https://discuss.hangfire.io/t/running-task-that-is-stored-in-an-object-within-a-reoccurringjob/4811 "2018-06-21T14:05:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cgwg1993](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/cgwg1993/32/1346_2.png) [@cgwg1993](https://discuss.hangfire.io/u/cgwg1993)
#### Post date: [June 21, 2018, 2:05pm UTC](https://discuss.hangfire.io/t/running-task-that-is-stored-in-an-object-within-a-reoccurringjob/4811/1 "2018-06-21T14:05:58Z")

</div>

Hi,

Within my application, I have created an Event object that includes an ID and a Task that needs to be run in this event as follows:-

```
public class Event
{
    public int Id { get; set; }
    // Other Variables Here
    public Task Action { get; set; }
}

```

In order for my application to work, I need to create a ReoccurringJob that gets the required Event based off the Id and runs the Action variable from this event. The code I currently have, and am having issues with is as follows:-

```
Event evnt = eventRepository.GetEvent(id);
RecurringJob.AddOrUpdate(evnt.Name, () => evnt.Action.Start(), Cron.MinuteInterval(int.Parse(evnt.Timing)));   

```

However, I am getting the issue

> No parameterless constructor defined for this object.

when viewing this on the DashBoard. Can anyone help me find a way to run this task?

Any help is greatly appreciated
