Exemplo n.º 1
0
        /// <summary>
        /// Factory method to create a new, unsaved <see cref="Resource"/> object
        /// with an associated <see cref="Assignment"/> object.
        /// </summary>
        /// <returns>A <see cref="Resource"/> instance object.</returns>
        internal static Resource NewResourceWithAssignment()
        {
            // Use the project factory to get an existing project
            Project project = ProjectFactory.ExistingProject();

            // Now create a resource and assign it to the project
            Resource resource = NewResource();

            resource.Assignments.AssignTo(project.Id);
            return(resource);
        }