public void Do() { var domain = new Domain( name: new Name("default"), title: new Title("title"), profile: new Profile( name: new Name(@"3/Defaults"), href: new Uri(@"href://www.restms.org/spec:3/Defaults") ), version: new AggregateVersion(0) ); var feed = new Feed( feedType: FeedType.Default, name: new Name("default"), title: new Title("Default feed") ); domain.AddFeed(feed.Id); using (var scope = new TransactionScope()) { _domainRepository.Add(domain); _feedRepository.Add(feed); scope.Complete(); } }
/// <summary> /// Initializes a new instance of the <see cref="RestMSDomain"/> class. /// </summary> /// <param name="domain">The domain.</param> /// <param name="feeds">The feeds.</param> public RestMSDomain(Domain domain, IEnumerable<Feed> feeds, IEnumerable<Pipe> pipes) { Name = domain.Name.Value; Title = domain.Title.Value; Href = domain.Href.AbsoluteUri; Profile = new RestMSProfile(domain.Profile); Feeds = feeds.Select(feed => new RestMSFeed(feed)).ToArray(); Pipes = pipes.Select(pipe => new RestMSPipeLink(pipe)).ToArray(); }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> protected bool Equals(Domain other) { return Equals(Name, other.Name); }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> protected bool Equals(Domain other) { return(Equals(Name, other.Name)); }