示例#1
0
        public static void AddParentLink([NotNull] this IWorkItem workItem, [NotNull] IWorkItemStore store, int parentId)
        {
            Contract.Requires(workItem != null);
            Contract.Requires(store != null);
            Contract.Requires(parentId > 0);

            if (workItem == null)
            {
                throw new ArgumentNullException(nameof(workItem));
            }
            if (store == null)
            {
                throw new ArgumentNullException(nameof(store));
            }
            if (parentId == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(parentId));
            }

            var end = store.GetParentLinkTypeEnd();

            workItem.Links.Add(workItem.CreateRelatedLink(parentId, end));
        }