public ActionResult Save(CreateProfileModel model) { try { Application.ApplicationRegistry.Profile.Create(model); ViewBag.Ok = "ok"; } catch { } return View(); }
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); }