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


C# IUnitOfWorkRepository类代码示例

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


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

示例1: RegistraRemovido

 public void RegistraRemovido(IPersistenciaBase entidade, IUnitOfWorkRepository unitofWorkRepository)
 {
     if (!entidadesDeletadas.ContainsKey(entidade))
     {
         entidadesDeletadas.Add(entidade, unitofWorkRepository);
     }
 }
开发者ID:cvcs,项目名称:.Net_Testing,代码行数:7,代码来源:UnitOfWork.cs

示例2: RegisterAmended

 public void RegisterAmended(IAggregateDataModel entity, IUnitOfWorkRepository unitofWorkRepository)
 {
     if (!changedEntities.ContainsKey(entity))
     {
         changedEntities.Add(entity, unitofWorkRepository);
     }
 }
开发者ID:elbandit,项目名称:PPPDDD,代码行数:7,代码来源:UnitOfWork.cs

示例3: RegisterDeletion

		public void RegisterDeletion(IAggregateRoot aggregateRoot, IUnitOfWorkRepository repository)
		{
			if (!_deletedAggregates.ContainsKey(aggregateRoot))
			{
				_deletedAggregates.Add(aggregateRoot, repository);
			}
		}
开发者ID:hanson-huang,项目名称:DDDSkeletonNet,代码行数:7,代码来源:InMemoryUnitOfWork.cs

示例4: RegistraNovo

 public void RegistraNovo(IPersistenciaBase entidade, IUnitOfWorkRepository unitofWorkRepository)
 {
     if (!entidadesAdicionadas.ContainsKey(entidade))
     {
         entidadesAdicionadas.Add(entidade, unitofWorkRepository);
     }
 }
开发者ID:cvcs,项目名称:.Net_Testing,代码行数:7,代码来源:UnitOfWork.cs

示例5: RegisterRemoved

 public void RegisterRemoved(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     if (!deletedEntities.ContainsKey(entity))
     {
         deletedEntities.Add(entity, unitOfWorkRepository);
     }
 }
开发者ID:xiaoyaopan,项目名称:Enterprise-Pattern,代码行数:7,代码来源:UnitOfWork.cs

示例6: RegisterUpdate

		public void RegisterUpdate(IAggregateRoot aggregateRoot, IUnitOfWorkRepository repository)
		{
			if (!_updatedAggregates.ContainsKey(aggregateRoot))
			{
				_updatedAggregates.Add(aggregateRoot, repository);
			}
		}
开发者ID:hanson-huang,项目名称:DDDSkeletonNet,代码行数:7,代码来源:InMemoryUnitOfWork.cs

示例7: RegisterAmended

 public void RegisterAmended(IAggregateRoot objectEntity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     if (!changedEntities.ContainsKey(objectEntity))
     {
         changedEntities.Add(objectEntity, unitOfWorkRepository);
     }
 }
开发者ID:uczenn,项目名称:VoteProject,代码行数:7,代码来源:UnitOfWork.cs

示例8: Add

 public void Add(IAggregateRoot entity, IUnitOfWorkRepository uowRepository)
 {
     if (!_addedEntities.ContainsKey(entity))
     {
         _addedEntities.Add(entity, uowRepository);
     }
 }
开发者ID:winsaludar,项目名称:Base,代码行数:7,代码来源:UnitOfWork.cs

示例9: CreateFirstSeason

        public Season CreateFirstSeason(Game game, List<Team> teams, IUnitOfWorkRepository repository)
        {
            // First check the number of teams can be evenly divided into the number of leagues.
             bool teamsOk = teams.Count % Constants.HowManyLeagues == 0;
             if (!teamsOk)
             {
            throw new Exception($"The number of teams must be divided by {Constants.HowManyLeagues}");
             }

             var newSeasonInfo = new NewSeasonInfo { Game = game, SeasonNumber = 0 };

             // Divide all teams between the four leagues based on the team rating.
             teams.Sort((team1, team2) => team2.Rating.CompareTo(team1.Rating));
             int countTeamsPerLeague = teams.Count / Constants.HowManyLeagues;
             newSeasonInfo.TeamsLeague1 = teams.Take(countTeamsPerLeague).ToList();
             newSeasonInfo.TeamsLeague2 = teams.Skip(countTeamsPerLeague).Take(countTeamsPerLeague).ToList();
             newSeasonInfo.TeamsLeague3 = teams.Skip(countTeamsPerLeague * 2).Take(countTeamsPerLeague).ToList();
             newSeasonInfo.TeamsLeague4 = teams.Skip(countTeamsPerLeague * 3).ToList();

             // The teams have been sorted on rating, so given them an initial league table position.
             AssignInitialLeagueTablePosition(teams);

             // In the first season there are no champion and cup winner yet, so pick the two best teams.
             newSeasonInfo.NationalChampion = teams[0];
             newSeasonInfo.NationalCupWinner = teams[1];

             // Now all teams have been placed in the right leagues, so create match schedules for all competitions.
             var seasonAndCompetitionSchedules = CreateSeasonAndCompetitionSchedules(newSeasonInfo);

             // Insert the season and all competition schedules.
             var season = InsertSeasonAndCompetitionSchedule(repository, seasonAndCompetitionSchedules);

             return season;
        }
开发者ID:bouwe77,项目名称:fmg,代码行数:34,代码来源:SeasonManager.cs

示例10: RegisterNew

 public void RegisterNew(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     if (!addedEntities.ContainsKey(entity))
     {
         addedEntities.Add(entity, unitOfWorkRepository);
     }
 }
开发者ID:xiaoyaopan,项目名称:Enterprise-Pattern,代码行数:7,代码来源:UnitOfWork.cs

示例11: RegisterRemoved

 public void RegisterRemoved(IAggregateRoot objectEntity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     if (!removedEntities.ContainsKey(objectEntity))
     {
         removedEntities.Add(objectEntity, unitOfWorkRepository);
     }
 }
开发者ID:uczenn,项目名称:VoteProject,代码行数:7,代码来源:UnitOfWork.cs

示例12: RegistroRemovido

 public void RegistroRemovido(IRaizDeAgregacao entidade,
 IUnitOfWorkRepository unitofWorkRepositorio)
 {
     if (!_entidadesDeletadas.ContainsKey(entidade))
     {
         _entidadesDeletadas.Add(entidade, unitofWorkRepositorio);
     }
 }
开发者ID:SyedArifulIslamEmon,项目名称:SystemsHealthManagement,代码行数:8,代码来源:UnitOfWork.cs

示例13: RegisterAdded

 /// <summary>
 /// Registers an <see cref="IEntity" /> instance to be added through this <see cref="Umbraco.Core.Persistence.UnitOfWork" />
 /// </summary>
 /// <param name="entity">The <see cref="IEntity" /></param>
 /// <param name="repository">The <see cref="IUnitOfWorkRepository" /> participating in the transaction</param>
 public void RegisterAdded(IEntity entity, IUnitOfWorkRepository repository)
 {
     _operations.Enqueue(new Operation
     {
         Entity = entity,
         Repository = repository,
         Type = TransactionType.Insert
     });
 }
开发者ID:ProNotion,项目名称:Merchello,代码行数:14,代码来源:PetaPocoUnitOfWork.cs

示例14: RegisterNew

 public void RegisterNew(IAggregateRoot entity, IUnitOfWorkRepository repository)
 {
     List<IAggregateRoot> items = null;
     if (!add.TryGetValue(repository, out items))
     {
         items = new List<IAggregateRoot>();
         add.Add(repository, items);
     }
     items.Add(entity);
 }
开发者ID:afrancocode,项目名称:ConcurrencyPatterns,代码行数:10,代码来源:UnitOfWork.cs

示例15: RegisterRemoved

		/// <summary>
		/// Registers an <see cref="IEntity" /> instance to be removed through this <see cref="UnitOfWork" />
		/// </summary>
		/// <param name="entity">The <see cref="IEntity" /></param>
		/// <param name="repository">The <see cref="IUnitOfWorkRepository" /> participating in the transaction</param>
		public void RegisterRemoved(IEntity entity, IUnitOfWorkRepository repository)
		{
			_operations.Add(
				new Operation
					{
						Entity = entity,
						ProcessDate = DateTime.Now,
						Repository = repository,
						Type = TransactionType.Delete
					});
		}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:16,代码来源:PetaPocoUnitOfWork.cs


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