Ejemplo n.º 1
0
        public Process AssignProcessProperties(Process request, Guid versionId)
        {
            int processVersion = 0;

            List <Process> processes = repo.Find(null, x => x.Name.Trim().ToLower() == request.Name.Trim().ToLower())?.Items;

            if (processes != null)
            {
                foreach (Process process in processes)
                {
                    if (processVersion < process.Version)
                    {
                        processVersion = process.Version;
                        versionId      = process.VersionId;
                    }
                }
            }

            request.Version = processVersion + 1;
            if (string.IsNullOrEmpty(request.Status))
            {
                request.Status = "Published";
            }
            request.VersionId = versionId;

            return(request);
        }