⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linkentityhelpercollection.cs

📁 CRM的移动平台代码
💻 CS
字号:
using System;
using Microsoft.Crm.Sandbox.Mobile.CrmServiceSdk;
using Microsoft.Crm.Sandbox.Mobile.Helpers;

namespace Microsoft.Crm.Sandbox.Mobile.Helpers.Collection
{
	public class LinkEntityHelperCollection : System.Collections.CollectionBase
	{
		// Fields
		private string _fromEntityName;

		#region Properties

		/// <summary>
		/// The entity that is being mapped from
		/// </summary>
		public string FromEntityName
		{
			get
			{
				return _fromEntityName;
			}
		}

		/// <summary>
		/// Provides access to the underlying collection of LinkEntityHelpers
		/// </summary>
		public LinkEntityHelper this[int index]
		{
			get
			{
				return (LinkEntityHelper)List[index];
			}
		}

		#endregion

		#region Constructor

		/// <summary>
		/// Used to create a collection of LinkEntityHelper objects
		/// </summary>
		/// <param name="fromEntityName">Specifies the entity that is being mapped from</param>
		public LinkEntityHelperCollection(string fromEntityName)
		{
			_fromEntityName = fromEntityName;
		}

		#endregion

		#region Methods

		/// <summary>
		/// Used to add a linked entity to the collection
		/// </summary>
		/// <param name="fromAttributeName">Specifies the attribute that is being mapped from in the query</param>
		/// <param name="toEntityName">Specifies the entity that is being mapped to in the query</param>
		/// <param name="toAttributeName">Specifies the attribute that is being mapped to in the query</param>
		/// <returns>A LinkEntityHelper object, that can be stored and used later to add filters</returns>
		public LinkEntityHelper AddLink(string fromAttributeName, string toEntityName, string toAttributeName)
		{
			return AddLink(fromAttributeName, toEntityName, toAttributeName, JoinOperator.Inner);
		}

		/// <summary>
		/// Used to add a linked entity to the collection
		/// </summary>
		/// <param name="fromAttributeName">Specifies the attribute that is being mapped from in the query</param>
		/// <param name="toEntityName">Specifies the entity that is being mapped to in the query</param>
		/// <param name="toAttributeName">Specifies the attribute that is being mapped to in the query</param>
		/// <param name="joinOperator">Specifies how the entities will be joined</param>
		/// <returns>A LinkEntityHelper object, that can be stored and used later to add filters</returns>
		public LinkEntityHelper AddLink(string fromAttributeName, string toEntityName, string toAttributeName, JoinOperator joinOperator)
		{
			LinkEntityHelper linkEntity = new LinkEntityHelper(_fromEntityName, fromAttributeName, toEntityName, toAttributeName, joinOperator);
			List.Add(linkEntity);

			return linkEntity;
		}

		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -