Exemplo n.º 1
0
        public JsonResult Create(Project project, Role role)
        {
            project.Created = DateTime.Now;
            project.Slug = project.Name.GenerateSlug();
            project.Admins.Add(new TeamMember(CurrentUser, role, true, true));
            RavenSession.Store(project);
            var user = RavenSession.Load<User>(CurrentUser.Id);

            if (user.Projects == null)
                user.Projects = new List<UserProject>();

            user.Projects.Add(new UserProject(project));
            RavenSession.SaveChanges();
            var url = string.Format("/{0}/{1}", project.Id, project.Slug);

            return Json(new { Success = true, Url = url });
        }
Exemplo n.º 2
0
 public Follow(Project project)
 {
     Id = project.Id;
     Name = project.Name;
 }
Exemplo n.º 3
0
 public UserProject(Project project)
 {
     Id = project.Id;
     Name = project.Name;
 }