public static void AddChildrenLink([NotNull] this IWorkItem workItem, [NotNull] IWorkItemStore store, [NotNull] params int[] childrenIds) { Contract.Requires(workItem != null); Contract.Requires(store != null); Contract.Requires(childrenIds != null); Contract.Requires(childrenIds.Length > 0); if (workItem == null) { throw new ArgumentNullException(nameof(workItem)); } if (store == null) { throw new ArgumentNullException(nameof(store)); } if (childrenIds == null) { throw new ArgumentNullException(nameof(childrenIds)); } if (childrenIds.Length == 0) { throw new ArgumentNullException(nameof(childrenIds)); } var end = store.GetChildLinkTypeEnd(); foreach (var id in childrenIds) { workItem.Links.Add(workItem.CreateRelatedLink(id, end)); } }
public static void AddChildLink([NotNull] this IWorkItem workItem, [NotNull] IWorkItemStore store, int childId) { Contract.Requires(workItem != null); Contract.Requires(store != null); Contract.Requires(childId > 0); if (workItem == null) { throw new ArgumentNullException(nameof(workItem)); } if (store == null) { throw new ArgumentNullException(nameof(store)); } if (childId == 0) { throw new ArgumentOutOfRangeException(nameof(childId)); } var end = store.GetChildLinkTypeEnd(); workItem.Links.Add(workItem.CreateRelatedLink(childId, end)); }
public static IWorkItemLinkTypeEnd GetParentLinkTypeEnd(this IWorkItemStore store) { return(store.GetChildLinkTypeEnd().OppositeEnd); }