C# TFS SDK Get Items from changeset

bdahl

I want to get the Content from an item from a specific Changeset. With my code, I get the correct number of items, but every property of the item is empty, only the correct URL is filled up. All other properties are set to null. How can I solve this?

string collectionUri = @"https://tfs.myServer.de/MyProject";
using (TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri)))
{
   TfvcHttpClient tfvcClient = tpc.GetClient<TfvcHttpClient>();
   var changedItems = tfvcClient.GetChangesetAsync(125453).Result;
   IEnumerable<TfvcChange> changesetChanges=tfvcClient.GetChangesetChangesAsync(changedItems.ChangesetId).Result;
   foreach (var itemsChange in changesetChanges)
   {
      Console.WriteLine(itemsChange.NewContent.Content);
   }
}
riQQ

This gets you the contents of the items of a changeset

private static async Task ReadContent(TfvcHttpClient tfvcClient)
{
    var changesetId = 123456;
    var changesetChanges = await tfvcClient.GetChangesetChangesAsync(changesetId);
    var tfvcVersionDescriptor = new TfvcVersionDescriptor(null, TfvcVersionType.Changeset, changesetId.ToString());

    foreach (var changesetChange in changesetChanges)
    {
        var path = changesetChange.Item.Path;
        Stream contentStream = await tfvcClient.GetItemContentAsync(path, versionDescriptor: tfvcVersionDescriptor);
        using (StreamReader streamReader = new StreamReader(contentStream))
        {
            var content = streamReader.ReadToEnd();
        }
    }
}

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Merging a changeset to parent's parent in TFS

分類Dev

How to get Items from ItemsSource?

分類Dev

TFS api get query parameters from context

分類Dev

TFS 2018: Set changeset author and date by REST API

分類Dev

Displaying items in C from an array

分類Dev

Can Azure pipelines get source from TFS Service Connection?

分類Dev

Get work item store from Tfs using powershell

分類Dev

How to delete items from array in .txt C

分類Dev

Removing items from c++ list

分類Dev

How can one access a hidden changeset from a Mercurial server?

分類Dev

ionic- $ http.get items from Json

分類Dev

Get custom values of variations from order items in WooCommerce

分類Dev

Get the person type name from cart items in Woocommerce Bookings

分類Dev

How to get items from cart at homepage when there is NO API

分類Dev

BeautifulSoup: How do I get different items from a <div>

分類Dev

How to get value from all selected dropdownlist items

分類Dev

Get all items of a certain type from a List of abstract type

分類Dev

(Swift/iOS) Is it possible to get user purchased items from In app purchases?

分類Dev

Get items from Ruby Array that occur 2 or more times

分類Dev

How to reduce the number of items in the TFS workspace

分類Dev

C# Adding items to MainForm ListBox from a different class

分類Dev

Get visible items in RecyclerView

分類Dev

How do I get Cloud Formation to create a changeset to update my Lambda functions?

分類Dev

Where to get OpenCL SDK?

分類Dev

How do I format the output from changeset using paper_trail in a view?

分類Dev

Override date when adding items to TFS using the APIs

分類Dev

TFS 2010で特定のChangeSetを削除するにはどうすればよいですか?

分類Dev

How do I get my search function work to filter searched items from table?

分類Dev

Get random items from hashtable but the total of values has to be equal to a set number

Related 関連記事

  1. 1

    Merging a changeset to parent's parent in TFS

  2. 2

    How to get Items from ItemsSource?

  3. 3

    TFS api get query parameters from context

  4. 4

    TFS 2018: Set changeset author and date by REST API

  5. 5

    Displaying items in C from an array

  6. 6

    Can Azure pipelines get source from TFS Service Connection?

  7. 7

    Get work item store from Tfs using powershell

  8. 8

    How to delete items from array in .txt C

  9. 9

    Removing items from c++ list

  10. 10

    How can one access a hidden changeset from a Mercurial server?

  11. 11

    ionic- $ http.get items from Json

  12. 12

    Get custom values of variations from order items in WooCommerce

  13. 13

    Get the person type name from cart items in Woocommerce Bookings

  14. 14

    How to get items from cart at homepage when there is NO API

  15. 15

    BeautifulSoup: How do I get different items from a <div>

  16. 16

    How to get value from all selected dropdownlist items

  17. 17

    Get all items of a certain type from a List of abstract type

  18. 18

    (Swift/iOS) Is it possible to get user purchased items from In app purchases?

  19. 19

    Get items from Ruby Array that occur 2 or more times

  20. 20

    How to reduce the number of items in the TFS workspace

  21. 21

    C# Adding items to MainForm ListBox from a different class

  22. 22

    Get visible items in RecyclerView

  23. 23

    How do I get Cloud Formation to create a changeset to update my Lambda functions?

  24. 24

    Where to get OpenCL SDK?

  25. 25

    How do I format the output from changeset using paper_trail in a view?

  26. 26

    Override date when adding items to TFS using the APIs

  27. 27

    TFS 2010で特定のChangeSetを削除するにはどうすればよいですか?

  28. 28

    How do I get my search function work to filter searched items from table?

  29. 29

    Get random items from hashtable but the total of values has to be equal to a set number

ホットタグ

アーカイブ