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


C# Domain.GetType方法代码示例

本文整理汇总了C#中Domain.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.GetType方法的具体用法?C# Domain.GetType怎么用?C# Domain.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Domain的用法示例。


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

示例1: StoreAsKnownLocation

 /// <summary>
 /// Stores the location object in the db of known locations
 /// </summary>
 /// <param name="location">location object to store, required fields should be populated</param>
 public void StoreAsKnownLocation(Domain.Location.Location location)
 {
     //Forces proxy loading
     location.GetType();
     location.LocationSensorDatas = CurrentLocation.LocationSensorDatas;
     _locations.Add(location);
 }
开发者ID:andrea-rockt,项目名称:Jarvis.Service,代码行数:11,代码来源:LocationProvider.cs

示例2: TryLoadFromSnapshot

        public bool TryLoadFromSnapshot(Type aggregateRootType, Snapshot snapshot, CommittedEventStream committedEventStream, out Domain.AggregateRoot aggregateRoot)
        {
            aggregateRoot = null;

            if (snapshot == null) return false;

            if (AggregateSupportsSnapshot(aggregateRootType, snapshot.Payload.GetType()))
            {
                try
                {
                    Log.DebugFormat("Reconstructing aggregate root {0}[{1}] from snapshot", aggregateRootType.FullName,
                                    snapshot.EventSourceId.ToString("D"));
                    aggregateRoot = _aggregateRootCreator.CreateAggregateRoot(aggregateRootType);
                    aggregateRoot.InitializeFromSnapshot(snapshot);
                    aggregateRoot.RestoreFromSnapshot(snapshot.Payload);

                    Log.DebugFormat("Applying remaining historic event to reconstructed aggregate root {0}[{1}]",
                        aggregateRootType.FullName, snapshot.EventSourceId.ToString("D"));
                    aggregateRoot.InitializeFromHistory(committedEventStream);
                }
                catch (Exception ex)
                {
                    Log.ErrorFormat("Cannot load snapshot for '{0}' aggregate. {1}",
                        aggregateRoot.GetType().FullName, ex.Message);
                    aggregateRoot = null;
                    return false;
                }

                return true;
            }

            return false;
        }
开发者ID:VincentSchippefilt,项目名称:ncqrs,代码行数:33,代码来源:AggregateDynamicSnapshotter.cs

示例3: TryTakeSnapshot

 public bool TryTakeSnapshot(Domain.AggregateRoot aggregateRoot, out Snapshot snapshot)
 {
     snapshot = null;
     try
     {
         var payload = ((dynamic)aggregateRoot).CreateSnapshot();
         snapshot = new Snapshot(aggregateRoot.EventSourceId, aggregateRoot.Version, payload);
         return true;
     }
     catch (Exception ex)
     {
         Log.ErrorFormat("Cannot take snapshot for '{0}' aggregate. {1}",
                 aggregateRoot.GetType().FullName, ex.Message);
         snapshot = null;
         return false;
     }
 }
开发者ID:VincentSchippefilt,项目名称:ncqrs,代码行数:17,代码来源:AggregateDynamicSnapshotter.cs

示例4: GenerateNumber

		public string GenerateNumber(Domain.Order.Model.Operation operation)
		{
			var now = DateTime.UtcNow;
			var retVal = operation.GetType().Name.Substring(0, 2).ToUpper() + now.DayOfYear.ToString("000") + now.TimeOfDay.Minutes.ToString("00");
			return retVal;
		}
开发者ID:alt-soft,项目名称:vc-community,代码行数:6,代码来源:TimeBasedNumberGeneratorImpl.cs

示例5: TransformPlanHistory

 private PlanHistory TransformPlanHistory(
     Domain.FleetPlanBC.Aggregates.AircraftPlanHistoryAgg.PlanHistory dbPlanHistory)
 {
     if (dbPlanHistory.GetType() != typeof (Domain.FleetPlanBC.Aggregates.AircraftPlanHistoryAgg.OperationPlan))
     {
         var planHistory = new OperationPlan
         {
             PlanHistoryID = dbPlanHistory.Id,
             PlanAircraftID = dbPlanHistory.PlanAircraftId,
             PlanID = dbPlanHistory.PlanId,
             ApprovalHistoryID = dbPlanHistory.ApprovalHistoryId,
             ActionCategoryID = dbPlanHistory.ActionCategoryId,
             TargetCategoryID = dbPlanHistory.TargetCategoryId,
             AircraftTypeID = dbPlanHistory.AircraftTypeId,
             AirlinesID = dbPlanHistory.AirlinesId,
             PerformAnnualID = dbPlanHistory.PerformAnnualId,
             CarryingCapacity = dbPlanHistory.CarryingCapacity,
             SeatingCapacity = dbPlanHistory.SeatingCapacity,
             IsValid = dbPlanHistory.IsValid,
             Note = dbPlanHistory.Note,
             IsSubmit = dbPlanHistory.IsSubmit,
         };
         var operationPlan = dbPlanHistory as Domain.FleetPlanBC.Aggregates.AircraftPlanHistoryAgg.OperationPlan;
         if (operationPlan != null)
         {
             planHistory.OperationHistoryID = operationPlan.OperationHistoryId;
         }
         if (dbPlanHistory.PlanAircraft != null)
         {
             planHistory.PlanAircraft = TransformPlanAircraft(dbPlanHistory.PlanAircraft);
             if (planHistory.PlanAircraft != null && dbPlanHistory.PlanAircraft.Aircraft != null)
             {
                 planHistory.PlanAircraft.Aircraft = TransformAircraft(dbPlanHistory.PlanAircraft.Aircraft);
             }
         }
         return planHistory;
     }
     if (dbPlanHistory.GetType() != typeof (Domain.FleetPlanBC.Aggregates.AircraftPlanHistoryAgg.ChangePlan))
     {
         var planHistory = new ChangePlan
         {
             PlanHistoryID = dbPlanHistory.Id,
             PlanAircraftID = dbPlanHistory.PlanAircraftId,
             PlanID = dbPlanHistory.PlanId,
             ApprovalHistoryID = dbPlanHistory.ApprovalHistoryId,
             ActionCategoryID = dbPlanHistory.ActionCategoryId,
             TargetCategoryID = dbPlanHistory.TargetCategoryId,
             AircraftTypeID = dbPlanHistory.AircraftTypeId,
             AirlinesID = dbPlanHistory.AirlinesId,
             PerformAnnualID = dbPlanHistory.PerformAnnualId,
             CarryingCapacity = dbPlanHistory.CarryingCapacity,
             SeatingCapacity = dbPlanHistory.SeatingCapacity,
             IsValid = dbPlanHistory.IsValid,
             Note = dbPlanHistory.Note,
             IsSubmit = dbPlanHistory.IsSubmit,
         };
         var changePlan = dbPlanHistory as Domain.FleetPlanBC.Aggregates.AircraftPlanHistoryAgg.ChangePlan;
         if (changePlan != null)
         {
             planHistory.AircraftBusinessID = changePlan.AircraftBusinessId;
         }
         if (dbPlanHistory.PlanAircraft != null)
         {
             planHistory.PlanAircraft = TransformPlanAircraft(dbPlanHistory.PlanAircraft);
             if (planHistory.PlanAircraft != null && dbPlanHistory.PlanAircraft.Aircraft != null)
             {
                 planHistory.PlanAircraft.Aircraft = TransformAircraft(dbPlanHistory.PlanAircraft.Aircraft);
             }
         }
         return planHistory;
     }
     return null;
 }
开发者ID:unicloud,项目名称:FRP,代码行数:73,代码来源:FleetTransferService.cs


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