• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FactMemento类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: DeprovisionFrontOffice

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


示例17: DeprovisionKitchen

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


示例18: Machine

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


示例19: Individual

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


示例20: ProvisionKitchen

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Faction类代码示例发布时间:2022-05-24
下一篇:
C# Facing类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap