public void Create(CreateProfileModel profile)
        {
            var p = new Model.Profile.ApplicationProfile(profile.ApplicationName, profile.ProfileName, (Model.Profile.ProfileContentType)profile.ContentType);
            p.UpdateContent(profile.Content);

            if (p.Validate())
            {
                Model.RepositoryRegistry.ApplicationProfile.Add(p);
                this.PublishEvent("Create", new Profile.CreateDomainEvents.CreateDomainEvent(p.Content, p.SubscribeKey));
                return;
            }
            throw new Easy.Domain.Base.BrokenRuleException(p.GetBrokenRules()[0].Name, p.GetBrokenRules()[0].Description);
        }
Пример #2
0
        public void Create(CreateProfileModel profile)
        {
            var p = new Model.Profile.ApplicationProfile(profile.ApplicationName, profile.ProfileName, (Model.Profile.ProfileContentType)profile.ContentType);

            p.UpdateContent(profile.Content);

            if (p.Validate())
            {
                Model.RepositoryRegistry.ApplicationProfile.Add(p);
                this.PublishEvent("Create", new Profile.CreateDomainEvents.CreateDomainEvent(p.Content, p.SubscribeKey));
                return;
            }
            throw new Easy.Domain.Base.BrokenRuleException(p.GetBrokenRules()[0].Name, p.GetBrokenRules()[0].Description);
        }