/// <summary> /// Initializes a new instance of the <see cref="Task"/> class. /// </summary> /// <param name="TaskId">The task id.</param> public Task(int TaskId) { TaskEntity = ApplicationContext.Current.Services.TaskService.GetTaskById(TaskId); if (TaskEntity == null) { throw new NullReferenceException("No task found with id " + TaskId); } }
internal Task(Umbraco.Core.Models.Task task) { TaskEntity = task; }