Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether [is in domain] [the specified domain].
        /// </summary>
        /// <param name="domain">The domain.</param>
        /// <returns><c>true</c> if [is in domain] [the specified domain]; otherwise, <c>false</c>.</returns>
        public bool IsInDomain(DomainModel.Domain domain)
        {
            foreach (var dom in this.Domains)
            {
                var parent = dom;
                while (parent != null)
                {
                    if (parent == domain)
                    {
                        return(true);
                    }

                    parent = parent.Parent;
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Bookses the in domain.
 /// </summary>
 /// <param name="domain">The domain.</param>
 /// <returns>System.Int32.</returns>
 public int BooksInDomain(DomainModel.Domain domain)
 {
     return(this.Books.Count(book => book.Book.IsInDomain(domain)));
 }