Esempio n. 1
0
        public BulkUpdateContents ToCommand()
        {
            var result = SimpleMapper.Map(this, new BulkUpdateContents());

            result.Jobs = Datas?.Select(x => new BulkUpdateJob {
                Type = BulkUpdateContentType.Create, Data = x
            }).ToArray();

            if (result.Jobs != null && Publish)
            {
                foreach (var job in result.Jobs)
                {
                    if (job != null)
                    {
                        job.Status = Status.Published;
                    }
                }
            }

            return(result);
        }
Esempio n. 2
0
        public BulkUpdateContents ToCommand()
        {
            var result = SimpleMapper.Map(this, new BulkUpdateContents());

            result.Jobs = Datas?.Select(x => new BulkUpdateJob {
                Type = BulkUpdateContentType.Create, Data = x
            }).ToArray();

#pragma warning disable CS0618 // Type or member is obsolete
            if (result.Jobs != null && Publish)
            {
                foreach (var job in result.Jobs)
                {
                    if (job != null)
                    {
                        job.Status = Status.Published;
                    }
                }
            }
#pragma warning restore CS0618 // Type or member is obsolete

            return(result);
        }