本文整理汇总了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;
}
示例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);
}
示例3: Initialize
public void Initialize(Contracts.Projections.RecipeView view)
{
RecipeId = view.Id.Id;
Title = view.Title;
Instructions = view.Instructions;
RecipeStatus = view.RecipeStatus;
}
示例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();
}
示例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
}
示例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);
}
}
示例7: SetOptions
public void SetOptions (Contracts.Options options)
{
CalenderUrl = options.CalenderUrl;
UserName = options.UserName;
UseAccountPassword = options.UseAccountPassword;
Password = options.Password;
EmailAddress = options.EmailAddress;
}
示例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;
}
示例9: AddAgent
public override void AddAgent(Contracts.Agents.AgentBase agent)
{
if (_queue.Count == 0)
{
_currentServedTime = 0;
}
_queue.Add(agent);
}
示例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);
}
示例11: SetOptions
public void SetOptions (Contracts.Options options)
{
EmailAddress = options.EmailAddress;
if (!string.IsNullOrEmpty (options.CalenderUrl))
CalenderUrl = options.CalenderUrl;
else
CalenderUrl = OptionTasks.GoogleDavBaseUrl;
}
示例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
}
示例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;
}
示例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;
}
示例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);
}