public override int GetHashCode() { return((GetType().GetHashCode() * 907) + AggregateId.GetHashCode()); }
internal CallForPapers(AggregateId id) => Id = id;
protected override IEnumerable <byte[]> GetSourceIdComponents() { yield return(BitConverter.GetBytes(MagicNumber)); yield return(AggregateId.GetBytes()); }
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; }
public override int GetHashCode() { return(AggregateId.GetHashCode()); }
public UserStatusChangedEvent(AggregateId id, UserStatus oldStatus, UserStatus newStatus) { Id = id; OldStatus = oldStatus; NewStatus = newStatus; }
public ChampagneRenamed(AggregateId id, ChampagneName oldName, ChampagneName newName) : base(id) { OldName = oldName; NewName = newName; }
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; }
private static string GetStreamId <T>(AggregateId <T> aggregateId) where T : AggregateRoot => $"{typeof(T).Name}-{aggregateId.Value:N}";
public Task <Submission> GetAsync(AggregateId id) => _submissions.Include(x => x.Speakers).SingleOrDefaultAsync(x => x.Id.Equals(id));
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);
public override string ToString() { return(GetType().Name + " [Id=" + AggregateId.ToString() + "]"); }
internal AgendaTrack(AggregateId id, ConferenceId conferenceId) { Id = id; ConferenceId = conferenceId; }
public VehicleNotFoundException(AggregateId id) : base($"Vehicle not found: {id}.") { }
public AggregateCreated(AggregateId id) { Id = id; }
public async Task DeleteAsync(AggregateId id) { _products.Remove(_products.SingleOrDefault(p => p.Id.Equals(id))); await Task.CompletedTask; }
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)));
public async Task <ProductsReport> GetAsync(AggregateId id) => await Task.FromResult(_reports.SingleOrDefault(r => r.Id.Equals(id)));
public ProductLine(AggregateId id, ProductLineCode productLine) : base(new ProductLineState(id, productLine)) { }
public SectionItem(AggregateId id, string productLine, Guid riskSectionId, Guid riskItemId) : base(new SectionItemState(id, productLine, riskSectionId, riskItemId)) { }
private Game FindById(AggregateId gameId) { return(_context.Games.SingleOrDefault(entity => entity.Id == gameId)); }
public SectionState(AggregateId id, Guid riskSectionId, string productLine) : base(id) { RiskSectionId = riskSectionId; ProductLine = productLine; Items = new Dictionary <string, SectionItem>(); }