Esempio n. 1
0
        internal WorkItemWrapper(EngineContext context, WorkItem item)
        {
            _context = context.Track(this);

            if (item.Id.HasValue)
            {
                Id = new PermanentWorkItemId(item.Id.Value);
                Changes.Add(new JsonPatchOperation()
                {
                    Operation = Operation.Test,
                    Path      = "/rev",
                    Value     = item.Rev
                });
            }
            else
            {
                Id = new TemporaryWorkItemId();
                Changes.Add(new JsonPatchOperation()
                {
                    Operation = Operation.Test,
                    Path      = "/id",
                    Value     = Id
                });
            }

            _item = item;
        }
Esempio n. 2
0
        public WorkItemWrapper(EngineContext context, WorkItemWrapper template, string type)
        {
            _context = context.Track(this);

            Id = new TemporaryWorkItemId();

            _item = new WorkItem();
            _item.Fields[CoreFieldRefNames.TeamProject]  = template.TeamProject;
            _item.Fields[CoreFieldRefNames.WorkItemType] = type;
            _item.Fields[CoreFieldRefNames.Id]           = Id.Value;

            Changes.Add(new JsonPatchOperation()
            {
                Operation = Operation.Test,
                Path      = "/id",
                Value     = Id
            });
        }