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"); } }
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"); } }