Exemplo n.º 1
0
 public override int GetHashCode()
 {
     return((GetType().GetHashCode() * 907) + AggregateId.GetHashCode());
 }
Exemplo n.º 2
0
 internal CallForPapers(AggregateId id)
 => Id = id;
Exemplo n.º 3
0
            protected override IEnumerable <byte[]> GetSourceIdComponents()
            {
                yield return(BitConverter.GetBytes(MagicNumber));

                yield return(AggregateId.GetBytes());
            }
Exemplo n.º 4
0
 public async Task <Product> GetAsync(AggregateId id)
 => await _databaseManager.QueryAsync(c =>
                                      c.QueryFirstAsync <Product>("SELECT * FROM Products WHERE Id = @id", new { id }));
 public UserLike(int no, AggregateId likedUserId)
 {
     No          = no;
     LikedUserId = likedUserId;
     Date        = DateTime.UtcNow;
 }
Exemplo n.º 6
0
 public override int GetHashCode()
 {
     return(AggregateId.GetHashCode());
 }
Exemplo n.º 7
0
 public UserStatusChangedEvent(AggregateId id, UserStatus oldStatus, UserStatus newStatus)
 {
     Id        = id;
     OldStatus = oldStatus;
     NewStatus = newStatus;
 }
Exemplo n.º 8
0
 public ChampagneRenamed(AggregateId id, ChampagneName oldName, ChampagneName newName) : base(id)
 {
     OldName = oldName;
     NewName = newName;
 }
Exemplo n.º 9
0
        public async Task <ReportRequest> GetAsync(AggregateId id)
        {
            var document = await _repository.GetAsync(r => r.Id == id);

            return(document?.AsEntity());
        }
 public UserLikeRemovedEvent(AggregateId id, int no, AggregateId likedUserId)
 {
     Id          = id;
     No          = no;
     LikedUserId = likedUserId;
 }
Exemplo n.º 11
0
 private static string GetStreamId <T>(AggregateId <T> aggregateId)
     where T : AggregateRoot
 => $"{typeof(T).Name}-{aggregateId.Value:N}";
Exemplo n.º 12
0
 public Task <Submission> GetAsync(AggregateId id)
 => _submissions.Include(x => x.Speakers).SingleOrDefaultAsync(x => x.Id.Equals(id));
Exemplo n.º 13
0
 public async Task <Product> GetAsync(AggregateId id)
 => await _context.Products.SingleOrDefaultAsync(p => p.Id == id);
 private Resource Act(AggregateId id, IEnumerable <string> tags) => Resource.Create(id, tags);
Exemplo n.º 15
0
 public override string ToString()
 {
     return(GetType().Name + " [Id=" + AggregateId.ToString() + "]");
 }
Exemplo n.º 16
0
 internal AgendaTrack(AggregateId id, ConferenceId conferenceId)
 {
     Id           = id;
     ConferenceId = conferenceId;
 }
 public VehicleNotFoundException(AggregateId id)
     : base($"Vehicle not found: {id}.")
 {
 }
Exemplo n.º 18
0
 public AggregateCreated(AggregateId id)
 {
     Id = id;
 }
Exemplo n.º 19
0
 public async Task DeleteAsync(AggregateId id)
 {
     _products.Remove(_products.SingleOrDefault(p => p.Id.Equals(id)));
     await Task.CompletedTask;
 }
Exemplo n.º 20
0
 public ProductSales(AggregateId productId, int totalSales)
 {
     ProductId  = productId;
     TotalSales = totalSales;
 }
 public async Task <Pair> GetPairForUsersAsync(AggregateId firstUserId, AggregateId secondUserId)
 => MapToAggregate(await Repository.GetByExpressionAsync(x =>
                                                         (x.FirstUserId == firstUserId.Id && x.SecondUserId == secondUserId.Id) ||
                                                         (x.SecondUserId == firstUserId.Id && x.FirstUserId == secondUserId.Id)));
Exemplo n.º 22
0
 public async Task <ProductsReport> GetAsync(AggregateId id)
 => await Task.FromResult(_reports.SingleOrDefault(r => r.Id.Equals(id)));
Exemplo n.º 23
0
 public ProductLine(AggregateId id, ProductLineCode productLine)
     : base(new ProductLineState(id, productLine))
 {
 }
Exemplo n.º 24
0
 public SectionItem(AggregateId id, string productLine, Guid riskSectionId, Guid riskItemId)
     : base(new SectionItemState(id, productLine, riskSectionId, riskItemId))
 {
 }
Exemplo n.º 25
0
 private Game FindById(AggregateId gameId)
 {
     return(_context.Games.SingleOrDefault(entity => entity.Id == gameId));
 }
Exemplo n.º 26
0
 public SectionState(AggregateId id, Guid riskSectionId, string productLine) : base(id)
 {
     RiskSectionId = riskSectionId;
     ProductLine   = productLine;
     Items         = new Dictionary <string, SectionItem>();
 }