Beispiel #1
0
        public JsonResult GetById(int id)
        {
            var task    = tasks.GetTaskById(id);
            var content = GetTasksContent();

            return(Json(new { task = task, content = content }));
        }
        public void TaskUpdated(int taskId)
        {
            string email = Context.User.Identity.Name;
            var    repo  = new TasksRepository(Properties.Settings.Default.ConStr);
            User   user  = repo.GetByEmail(email);
            Task   t     = repo.GetTaskById(taskId);

            Clients.All.BtnUpdate(new
            {
                id        = t.Id,
                title     = t.Title,
                isHandled = t.IsHandled,
                working   = t.IsHandled == user.Id,
                userFirst = t.User == null ? null : t.User.FirstName,
                userLast  = t.User == null ? null : t.User.LastName
            });
        }
 public async Task <IHttpActionResult> GetTask(int id)
 {
     return(Ok(await repository.GetTaskById(id)));
 }