PivotalTrackerAPI/Domain/Model/PivotalTask.cs
/// <summary>
/// Updates the task with new values
/// </summary>
/// <remarks>Uses reflection to iterate properties, so does carry some overhead in terms of performance</remarks>
/// <param name="user">The user to get the ApiToken from</param>
/// <param name="story">The story the task belongs to</param>
/// <returns>The updated task instance</returns>
Updates the task with new values
Updates the task with new values
public PivotalTask UpdateTask(PivotalUser user, PivotalStory story)
    {
      PivotalTask updatedTask = PivotalTask.UpdateTask(user, story.ProjectId.GetValueOrDefault(), story.Id.GetValueOrDefault(), this);
      System.Reflection.PropertyInfo[] properties = this.GetType().GetProperties();
      foreach (System.Reflection.PropertyInfo p in properties)
      {
        p.SetValue(this, p.GetValue(updatedTask, null), null);
      }
      return this;
    }
public PivotalTask UpdateTask ( PivotalUser user , PivotalStory story ) { PivotalTask updatedTask = PivotalTask . UpdateTask ( user , story . ProjectId . GetValueOrDefault ( ) , story . Id . GetValueOrDefault ( ) , this ) ; System . Reflection . PropertyInfo [ ] properties = this . GetType ( ) . GetProperties ( ) ; foreach ( System . Reflection . PropertyInfo p in properties ) { p . SetValue ( this , p . GetValue ( updatedTask , null ) , null ) ; } return this ; }
Updates the task with new values
Updates the task with new values
The updated task instance
The updated task instance
user
PivotalUser
The user to get the ApiToken from
The user to get the ApiToken from
story
PivotalStory
The story the task belongs to
The story the task belongs to
remarks
Uses reflection to iterate properties, so does carry some overhead in terms of performance
Uses reflection to iterate properties so does carry some overhead in terms of performance