public LinkedList <IAggregateEvent> GetEvents(string aggregateName) { var aggregateId = int.Parse(aggregateName); var list = _genericEntityService.Get <Event>(q => q.Where(x => x.AggregateId == aggregateId).ToList()); return(new LinkedList <IAggregateEvent>(_eventToAggregateEventMapper.Map(list))); }
public LinkedList<IAggregateEvent> GetEvents(string aggregateName) { using (var connection = new SqlConnection(_connectionString)) { var aggregateId = int.Parse(aggregateName); return _eventToAggregateEventMapper.Map(connection.Query<Event>(SELECT_ALL_EVENTS, new { AggregateId = aggregateId }).ToList()); } }
public LinkedList <IAggregateEvent> GetEvents(string aggregateName) { var aggregateId = int.Parse(aggregateName); var events = allEvents.Select(x => x.Clone()) .Cast <Event>() .Where(x => x.AggregateId == aggregateId) .ToList(); return(_eventToAggregateEventMapper.Map(events)); }