コード例 #1
0
 public ResourceAssignmentEdit AssignTo(int projectId)
 {
     if (!(Contains(projectId)))
     {
         var project = ResourceAssignmentEditCreator.GetResourceAssignmentEditCreator(projectId).Result;
         this.Add(project);
         return(project);
     }
     else
     {
         throw new InvalidOperationException("Resource already assigned to project");
     }
 }
コード例 #2
0
        public async Task <ResourceAssignmentEdit> AssignToAsync(int projectId)
        {
            if (!(Contains(projectId)))
            {
                var project = await ResourceAssignmentEditCreator.GetResourceAssignmentEditCreatorAsync(projectId);

                this.Add(project.Result);
                return(project.Result);
            }
            else
            {
                throw new InvalidOperationException("Resource already assigned to project");
            }
        }