Пример #1
0
        private VmEntityHeaderBase PublishOrganization(IUnitOfWorkWritable unitOfWork, IVmPublishingModel model)
        {
            Guid?organizationId = model.Id;
            //Validate mandatory values
            var validationMessages = ValidationManager.CheckEntity <OrganizationVersioned>(organizationId.Value, unitOfWork, model);

            if (validationMessages.Any())
            {
                throw new PtvValidationException(validationMessages, null);
            }

            //Publishing
            var affected = CommonService.PublishEntity <OrganizationVersioned, OrganizationLanguageAvailability>(unitOfWork, model);

            return(GetOrganizationHeader(affected.Id, unitOfWork));
        }