linkentityhelpercollection.cs

来自「CRM的移动平台代码」· CS 代码 · 共 64 行

CS
64
字号
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
	{

		private string _fromEntityName;

		#region Properties


		public string FromEntityName
		{
			get
			{
				return _fromEntityName;
			}
		}


		public LinkEntityHelper this[int index]
		{
			get
			{
				return (LinkEntityHelper)List[index];
			}
		}

		#endregion

		#region Constructor


		public LinkEntityHelperCollection(string fromEntityName)
		{
			_fromEntityName = fromEntityName;
		}

		#endregion

		#region Methods


		public LinkEntityHelper AddLink(string fromAttributeName, string toEntityName, string toAttributeName)
		{
			return AddLink(fromAttributeName, toEntityName, toAttributeName, JoinOperator.Inner);
		}


		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 + =
减小字号Ctrl + -
显示快捷键?