本文整理汇总了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);
}
}
示例2: RegisterAmended
public void RegisterAmended(IAggregateDataModel entity, IUnitOfWorkRepository unitofWorkRepository)
{
if (!changedEntities.ContainsKey(entity))
{
changedEntities.Add(entity, unitofWorkRepository);
}
}
示例3: RegisterDeletion
public void RegisterDeletion(IAggregateRoot aggregateRoot, IUnitOfWorkRepository repository)
{
if (!_deletedAggregates.ContainsKey(aggregateRoot))
{
_deletedAggregates.Add(aggregateRoot, repository);
}
}
示例4: RegistraNovo
public void RegistraNovo(IPersistenciaBase entidade, IUnitOfWorkRepository unitofWorkRepository)
{
if (!entidadesAdicionadas.ContainsKey(entidade))
{
entidadesAdicionadas.Add(entidade, unitofWorkRepository);
}
}
示例5: RegisterRemoved
public void RegisterRemoved(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
{
if (!deletedEntities.ContainsKey(entity))
{
deletedEntities.Add(entity, unitOfWorkRepository);
}
}
示例6: RegisterUpdate
public void RegisterUpdate(IAggregateRoot aggregateRoot, IUnitOfWorkRepository repository)
{
if (!_updatedAggregates.ContainsKey(aggregateRoot))
{
_updatedAggregates.Add(aggregateRoot, repository);
}
}
示例7: RegisterAmended
public void RegisterAmended(IAggregateRoot objectEntity, IUnitOfWorkRepository unitOfWorkRepository)
{
if (!changedEntities.ContainsKey(objectEntity))
{
changedEntities.Add(objectEntity, unitOfWorkRepository);
}
}
示例8: Add
public void Add(IAggregateRoot entity, IUnitOfWorkRepository uowRepository)
{
if (!_addedEntities.ContainsKey(entity))
{
_addedEntities.Add(entity, uowRepository);
}
}
示例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;
}
示例10: RegisterNew
public void RegisterNew(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
{
if (!addedEntities.ContainsKey(entity))
{
addedEntities.Add(entity, unitOfWorkRepository);
}
}
示例11: RegisterRemoved
public void RegisterRemoved(IAggregateRoot objectEntity, IUnitOfWorkRepository unitOfWorkRepository)
{
if (!removedEntities.ContainsKey(objectEntity))
{
removedEntities.Add(objectEntity, unitOfWorkRepository);
}
}
示例12: RegistroRemovido
public void RegistroRemovido(IRaizDeAgregacao entidade,
IUnitOfWorkRepository unitofWorkRepositorio)
{
if (!_entidadesDeletadas.ContainsKey(entidade))
{
_entidadesDeletadas.Add(entidade, unitofWorkRepositorio);
}
}
示例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
});
}
示例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);
}
示例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
});
}