Esempio n. 1
0
 public string AddProjectToUserAccount([FromBody] IncomingProjectUser incomingRequest)
 {
     using (var context = new DatabaseController(Context, Configuration))
     {
         context.AddProjectToUser(incomingRequest);
     }
     return("true");
 }
        internal void AddProjectToUser(IncomingProjectUser incomingRequest)
        {
            var project = Context.Projects.FirstOrDefault(x => x.Id == incomingRequest.Id);

            Context.AssociatedProjectMembers.Add(new AssociatedProjectMembers
            {
                ProjectId     = incomingRequest.Id,
                UserAccountId = incomingRequest.UserId,
                RepositoryId  = project.RepositoryId
            });
            Context.SaveChanges();
        }