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


C# FactMemento类代码示例

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


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

示例1: CreateRoom

 protected static FactMemento CreateRoom(long domainId)
 {
     FactMemento room = new FactMemento(TypeRoom);
     room.Data = new byte[] { 1, 2, 3, 4 };
     room.AddPredecessor(RoleRoomDomain, new FactID { key = domainId }, true);
     return room;
 }
开发者ID:wuttic,项目名称:CorrespondenceDistributor,代码行数:7,代码来源:TestBase.cs

示例2: FindExistingFact

 public FactID? FindExistingFact(string domain, FactMemento fact)
 {
     using (var procedures = new Procedures(new Session(_connectionString)))
     {
         FactID id;
         if (FindExistingFact(fact, out id, procedures, readCommitted: true))
             return id;
         return null;
     }
 }
开发者ID:wuttic,项目名称:CorrespondenceDistributor,代码行数:10,代码来源:Repository.cs

示例3: FindExistingFact

 public FactID? FindExistingFact(string domain, FactMemento memento)
 {
     lock (this)
     {
         // See if the fact already exists.
         FactRecord fact = _factTable.FirstOrDefault(o =>
             o.IdentifiedFactMemento.Memento.Equals(memento));
         if (fact == null)
             return null;
         else
             return fact.IdentifiedFactMemento.Id;
     }
 }
开发者ID:wuttic,项目名称:CorrespondenceDistributor,代码行数:13,代码来源:MockRepository.cs

示例4: CreateFact

			public CorrespondenceFact CreateFact(FactMemento memento)
			{
				Identity newFact = new Identity(memento);

				// Create a memory stream from the memento data.
				using (MemoryStream data = new MemoryStream(memento.Data))
				{
					using (BinaryReader output = new BinaryReader(data))
					{
						newFact._anonymousId = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
					}
				}

				return newFact;
			}
开发者ID:michaellperry,项目名称:FacetedWorlds.ThoughtCloud,代码行数:15,代码来源:Model.generated.cs

示例5: ContactInformation

 // Hydration constructor
 private ContactInformation(FactMemento memento)
 {
     InitializeResults();
     _order = new PredecessorObj<Order>(this, RoleOrder, memento);
     _prior = new PredecessorList<ContactInformation>(this, RolePrior, memento);
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:7,代码来源:Model.generated.cs

示例6: Company

 // Hydration constructor
 private Company(FactMemento memento)
 {
     InitializeResults();
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:5,代码来源:Model.generated.cs

示例7: Closed

 // Hydration constructor
 private Closed(FactMemento memento)
 {
     InitializeResults();
     _delivered = new PredecessorObj<Delivered>(this, RoleDelivered, memento);
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:6,代码来源:Model.generated.cs

示例8: Pull

 // Hydration constructor
 private Pull(FactMemento memento)
 {
     InitializeResults();
     _order = new PredecessorObj<Order>(this, RoleOrder, memento);
     _kitchen = new PredecessorObj<Kitchen>(this, RoleKitchen, memento);
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:7,代码来源:Model.generated.cs

示例9: ProvisionFrontOffice

 // Hydration constructor
 private ProvisionFrontOffice(FactMemento memento)
 {
     InitializeResults();
     _machine = new PredecessorObj<Machine>(this, RoleMachine, memento);
     _company = new PredecessorObj<Company>(this, RoleCompany, memento);
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:7,代码来源:Model.generated.cs

示例10: CakeDetail

 // Hydration constructor
 private CakeDetail(FactMemento memento)
 {
     InitializeResults();
     _order = new PredecessorObj<Order>(this, RoleOrder, memento);
     _size = new PredecessorObj<CakeSize>(this, RoleSize, memento);
     _cakeFlavor = new PredecessorObj<CakeFlavor>(this, RoleCakeFlavor, memento);
     _frostingFlavor = new PredecessorObj<FrostingFlavor>(this, RoleFrostingFlavor, memento);
     _mainColor = new PredecessorObj<FrostingColor>(this, RoleMainColor, memento);
     _decorationColor = new PredecessorObj<FrostingColor>(this, RoleDecorationColor, memento);
     _prior = new PredecessorList<CakeDetail>(this, RolePrior, memento);
 }
开发者ID:mallardsoft,项目名称:NanasNook,代码行数:12,代码来源:Model.generated.cs

示例11: EnableToastNotification

 // Hydration constructor
 private EnableToastNotification(FactMemento memento)
 {
     InitializeResults();
     _individual = new PredecessorObj<Individual>(this, RoleIndividual, memento);
 }
开发者ID:michaellperry,项目名称:Multichat,代码行数:6,代码来源:Model.generated.cs

示例12: CreateFact

            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Domain newFact = new Domain(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                    }
                }

                return newFact;
            }
开发者ID:michaellperry,项目名称:Multichat,代码行数:14,代码来源:Model.generated.cs

示例13: Domain

 // Hydration constructor
 private Domain(FactMemento memento)
 {
     InitializeResults();
 }
开发者ID:michaellperry,项目名称:Multichat,代码行数:5,代码来源:Model.generated.cs

示例14: DisableToastNotification

 // Hydration constructor
 private DisableToastNotification(FactMemento memento)
 {
     InitializeResults();
     _enable = new PredecessorList<EnableToastNotification>(this, RoleEnable, memento);
 }
开发者ID:michaellperry,项目名称:Multichat,代码行数:6,代码来源:Model.generated.cs

示例15: Save

        public FactID Save(string domain, FactMemento fact, Guid clientGuid)
        {
            FactID factId;
            List<FactID> affectedPivots;

            lock (this)
            {
                // See if the fact already exists.
                FactRecord existingFact = _factTable.FirstOrDefault(o =>
                    o.IdentifiedFactMemento.Memento.Equals(fact));
                if (existingFact == null)
                {
                    // It doesn't, so create it.
                    FactID newFactID = new FactID() { key = _factTable.Count + 1 };
                    factId = newFactID;
                    existingFact = new FactRecord()
                    {
                        IdentifiedFactMemento = new IdentifiedFactMemento(factId, fact)
                    };

                    _factTable.Add(existingFact);

                    // Store a message for each pivot.
                    var pivots = fact.Predecessors
                        .Where(predecessor => predecessor.IsPivot);
                    _messageTable.AddRange(pivots
                        .Select(predecessor => new MessageRecord(
                            new MessageMemento(predecessor.ID, newFactID),
                            newFactID,
                            predecessor.Role,
                            clientGuid)));

                    // Store messages for each non-pivot. This fact belongs to all predecessors' pivots.
                    List<FactID> nonPivots = fact.Predecessors
                        .Where(predecessor => !predecessor.IsPivot)
                        .Select(predecessor => predecessor.ID)
                        .ToList();
                    List<MessageRecord> predecessorsPivots = _messageTable
                        .Where(message => nonPivots.Contains(message.Message.FactId))
                        .Distinct()
                        .ToList();
                    _messageTable.AddRange(predecessorsPivots
                        .Select(predecessorPivot => new MessageRecord(
                            new MessageMemento(predecessorPivot.Message.PivotId, newFactID),
                            predecessorPivot.AncestorFact,
                            predecessorPivot.AncestorRole,
                            clientGuid)));

                    affectedPivots =
                        pivots
                            .Select(pivot => pivot.ID)
                        .Union(predecessorsPivots
                            .Select(predecessorPivot => predecessorPivot.Message.PivotId))
                        .ToList();
                }
                else
                {
                    factId = existingFact.IdentifiedFactMemento.Id;
                    affectedPivots = null;
                }
            }

            if (affectedPivots != null && affectedPivots.Any() && PivotAffected != null)
                foreach (var pivotId in affectedPivots)
                    PivotAffected(domain, pivotId, factId, clientGuid);

            return factId;
        }
开发者ID:wuttic,项目名称:CorrespondenceDistributor,代码行数:68,代码来源:MockRepository.cs


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