コード例 #1
0
        /// <summary>
        ///     Tries to find a referencing entity with the given <paramref name="id" />.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public TEntity FindEntity(int id)
        {
            var entity = ReferencingGroup.FindEntity(id);

            if (entity != null &&
                ContainsEntity(entity))
            {
                return(entity);
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        ///     Returns <c>true</c> if there is a referencing entity with the given <paramref name="id" />.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool ContainsEntity(int id)
        {
            var entity = ReferencingGroup.FindEntity(id);

            return(entity != null && ContainsEntity(entity));
        }