public void UpdateActivity(Activity activity)
 {
     context.Entry(activity).State = System.Data.Entity.EntityState.Modified;
 }
 public void InsertActivity(Activity activity)
 {
     if (activity.FolderId == 0)
         activity.FolderId = context.Folders.First().Id;
     context.Activities.Add(activity);
 }
        public JsonResponse<Activity> InsertActivity(int folderId, Activity activity)
        {
            return new JsonResponse<Activity>(Request, () =>
            {
                if (activity == null)
                    throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest));

                activityRepository.InsertActivity(activity);
                activityRepository.Save();
                return activity;
            });
        }