当前位置: 首页>>代码示例>>C#>>正文


C# Contracts类代码示例

本文整理汇总了C#中Contracts的典型用法代码示例。如果您正苦于以下问题:C# Contracts类的具体用法?C# Contracts怎么用?C# Contracts使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Contracts类属于命名空间,在下文中一共展示了Contracts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsEqual

        /// <summary>
        /// Determines whether the specified <see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /> is to <paramref name="otherKeyword" />
        /// </summary>
        /// <param name="keyword"><see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /></param>
        /// <param name="otherKeyword"><see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /></param>
        /// <returns><c>true</c> if the <see cref="T:TcmCDService.ContentDelivery.TcmUri" /> is equal, otherwise <c>false</c>.</returns>
        internal static Boolean IsEqual(this Keyword keyword, Contracts.Keyword otherKeyword)
        {
            if (keyword != null && otherKeyword != null)
                return (TcmUri)keyword.KeywordUri == (TcmUri)otherKeyword.Uri;

            return false;
        }
开发者ID:TcmExtensions,项目名称:TcmCDService,代码行数:13,代码来源:ContractExtensions.cs

示例2: CompareContractWithSavedEntity

        public static void CompareContractWithSavedEntity(Contracts.Curve contract)
        {
            int id = int.Parse(contract.Identifiers.Where(x => x.IsNexusId).First().Identifier);
            var savedEntity = new DbSetRepository<MDM.Curve>(new MappingContext()).FindOne<MDM.Curve>(id);

            CompareContractWithEntityDetails(contract, savedEntity);
        }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:7,代码来源:CurveDataChecker.cs

示例3: Initialize

 public void Initialize(Contracts.Projections.RecipeView view)
 {
     RecipeId = view.Id.Id;
     Title = view.Title;
     Instructions = view.Instructions;
     RecipeStatus = view.RecipeStatus;
 }
开发者ID:gnschenker,项目名称:RecipesWithCqrsAndEs,代码行数:7,代码来源:RecipeViewModelState.cs

示例4: registrirajUporabnika

        public string registrirajUporabnika(Contracts.Data.Uporabnik uporabnik)
        {
            Uporabnik u = udao.Read(uporabnik.Upime);
            if (u != null) return "false";

            return udao.Create(uporabnik).ToString();
        }
开发者ID:gpanic,项目名称:fleamart,代码行数:7,代码来源:UporabnikService.svc.cs

示例5: Delete

		public async Task Delete(Contracts.Entities.Item e)
        {
			e.ItemProperties = null;
			Uow.MarkDeleted(e);
			await Task.FromResult(0);
			// Uow.ExecuteSqlCommand("delete from ItemProperty where ItemID = " + e.ItemID); => delete cascade
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:7,代码来源:ItemRepository.cs

示例6: Store

		public async Task Store(Contracts.Entities.Item item)
		{
			// search und update machine

			int id = item.ItemID;

			var itemInDb = await Context.Items.
				Where((m) => m.ItemID == id).
				Include((d) => d.ItemProperties).
				FirstOrDefaultAsync();

            var optValues = item.ItemProperties ?? new List<Contracts.Entities.ItemProperty>();

			if (itemInDb == default(Contracts.Entities.Item))
			{
                // add new
				Uow.MarkNew(item);
			}
			else
			{
                // syn with existing

                Uow.SetValue(itemInDb,item);

				// search und update machinecommands (add and delete)

				Sync<Contracts.Entities.ItemProperty>(
                    itemInDb.ItemProperties,
                    optValues, 
					(x, y) => x.ItemID > 0 && x.ItemID == y.ItemID && x.Name == y.Name);
			}
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:32,代码来源:ItemRepository.cs

示例7: SetOptions

 public void SetOptions (Contracts.Options options)
 {
   CalenderUrl = options.CalenderUrl;
   UserName = options.UserName;
   UseAccountPassword = options.UseAccountPassword;
   Password = options.Password;
   EmailAddress = options.EmailAddress;
 }
开发者ID:aluxnimm,项目名称:outlookcaldavsynchronizer,代码行数:8,代码来源:ServerSettingsTemplateViewModel.cs

示例8: CheckCompletionCode

 /// <summary>
 /// This checks for valid completion code for all functions
 /// </summary>
 /// <param name="responseCompletionCode"></param>
 /// <returns></returns>
 public static bool CheckCompletionCode(Contracts.CompletionCode responseCompletionCode)
 {
     if (responseCompletionCode == Contracts.CompletionCode.Success)
     {
         return true;
     }
     return false;
 }
开发者ID:silupher,项目名称:ChassisManager,代码行数:13,代码来源:ChassisManagerUtil.cs

示例9: AddAgent

 public override void AddAgent(Contracts.Agents.AgentBase agent)
 {
     if (_queue.Count == 0)
     {
         _currentServedTime = 0;
     }
     _queue.Add(agent);
 }
开发者ID:nomoreserious,项目名称:FlowSimulation,代码行数:8,代码来源:Queue.cs

示例10: ConfirmEntitySaved

        public static void ConfirmEntitySaved(int id, Contracts.Curve contract)
        {
            var savedEntity =
                new DbSetRepository<MDM.Curve>(new MappingContext()).FindOne<MDM.Curve>(id);
            contract.Identifiers.Add(new NexusId() { IsNexusId = true, Identifier = id.ToString() });

            CompareContractWithEntityDetails(contract, savedEntity);
        }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:8,代码来源:CurveDataChecker.cs

示例11: SetOptions

 public void SetOptions (Contracts.Options options)
 {
   EmailAddress = options.EmailAddress;
   if (!string.IsNullOrEmpty (options.CalenderUrl))
     CalenderUrl = options.CalenderUrl;
   else
     CalenderUrl = OptionTasks.GoogleDavBaseUrl;
 }
开发者ID:aluxnimm,项目名称:outlookcaldavsynchronizer,代码行数:8,代码来源:GoogleServerSettingsTemplateViewModel.cs

示例12: Delete

		public async Task Delete(Contracts.Entities.Machine m)
        {
			m.MachineCommands = null;
			m.MachineInitCommands = null;
			Uow.MarkDeleted(m);
			await Task.FromResult(0);
			//Uow.ExecuteSqlCommand("delete from MachineCommand where MachineID = " + m.MachineID); => delete cascade
			//Uow.ExecuteSqlCommand("delete from MachineInitCommand where MachineID = " + m.MachineID); => delete cascade
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:9,代码来源:MachineRepository.cs

示例13: Message

 public Message(DateTimeOffset timestamp, bool isOutbound, string subject, string content, Contracts.IProviderDescription provider)
 {
     Timestamp = timestamp;
     Direction = isOutbound ? MessageDirection.Outbound : MessageDirection.Inbound;
     Subject = subject;
     Content = content;
     Provider = provider;
     MessageType = MessageType.Email;
 }
开发者ID:CallWall,项目名称:CallWall.Web,代码行数:9,代码来源:FakeGoogleCommunicationProvider.cs

示例14: ServiceModel

        public ServiceModel(ulong id, string name, Contracts.Services.Metadata.IServiceManagerMetadata serviceMetadata, Dictionary<string, object> settings)
        {
            Id = id;

            _name = name;
            _managerCode = serviceMetadata.Code;
            _typeName = serviceMetadata.FancyName;
            _settings = settings;
        }
开发者ID:nomoreserious,项目名称:FlowSimulation,代码行数:9,代码来源:ServiceModel.cs

示例15: Send

        public void Send(Contracts.MessageContract contract)
        {
            BrokeredMessage msg = new BrokeredMessage(contract);

            //ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;

            System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

            _Client.Send(msg);
        }
开发者ID:Notifyd,项目名称:notifyd,代码行数:10,代码来源:QueueClient.cs


注:本文中的Contracts类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。