PivotalTrackerAPI/Domain/Model/PivotalProject.cs
/// <summary>
/// Fetches a single project from Pivotal and optionally retrieves the stories and sets them in the Stories property
/// </summary>
/// <param name="user">The user to get the ApiToken from</param>
/// <param name="projectId">The id of the project to retrieve</param>
/// <param name="loadStories">Whether to fetch stories and save them in the Stories property</param>
/// <returns>project</returns>
Fetches a single project from Pivotal and optionally retrieves the stories and sets them in the Stories property
Fetches a single project from Pivotal and optionally retrieves the stories and sets them in the Stories property
public static PivotalProject FetchProject(PivotalUser user, int projectId, bool loadStories)
    {
      string url = String.Format("{0}/projects/{1}?token={2}", PivotalService.BaseUrl, projectId.ToString(), user.ApiToken);
      XmlDocument xml = PivotalService.GetData(url);
      PivotalProject project = SerializationHelper.DeserializeFromXmlDocument<PivotalProject>(xml);
      if (loadStories)
      {
        project.LoadStories(user);
      }
      return project;
    }
public static PivotalProject FetchProject ( PivotalUser user , int projectId , bool loadStories ) { string url = String . Format ( " " , PivotalService . BaseUrl , projectId . ToString ( ) , user . ApiToken ) ; XmlDocument xml = PivotalService . GetData ( url ) ; PivotalProject project = SerializationHelper . DeserializeFromXmlDocument < PivotalProject > ( xml ) ; if ( loadStories ) { project . LoadStories ( user ) ; } return project ; }
Fetches a single project from Pivotal and optionally retrieves the stories and sets them in the Stories property
Fetches a single project from Pivotal and optionally retrieves the stories and sets them in the Stories property
None
user
PivotalUser
The user to get the ApiToken from
The user to get the ApiToken from
projectId
int
The id of the project to retrieve
The id of the project to retrieve
loadStories
bool
Whether to fetch stories and save them in the Stories property
Whether to fetch stories and save them in the Stories property