コード例 #1
0
        /// <summary>
        /// Returns a <see cref="EntitySetInfo"/> from a custom <see cref="OrganizationServiceContext"/> class and an entity logical name.
        /// </summary>
        /// <param name="contextType"></param>
        /// <param name="entityLogicalName"></param>
        /// <param name="entitySetInfo"></param>
        /// <returns></returns>
        public static bool TryGet(Type contextType, string entityLogicalName, out EntitySetInfo entitySetInfo)
        {
            entitySetInfo = null;
            OrganizationServiceContextInfo contextInfo;

            return(TryGet(contextType, out contextInfo) && contextInfo.EntitySetsByEntityLogicalName.TryGetValue(entityLogicalName, out entitySetInfo));
        }
コード例 #2
0
 /// <summary>
 /// Returns a <see cref="EntitySetInfo"/> from a custom <see cref="OrganizationServiceContext"/> class and an entity.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="entity"></param>
 /// <param name="entitySetInfo"></param>
 /// <returns></returns>
 public static bool TryGet(OrganizationServiceContext context, Entity entity, out EntitySetInfo entitySetInfo)
 {
     return(TryGet(context.GetType(), entity.LogicalName, out entitySetInfo));
 }