示例#1
0
        public async Task HandleAsync(ProductCreated @event)
        {
            if (@event == null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            var product = await _dao.GetAsync(@event.SourceId) ?? _dao.Add(@event.SourceId);

            product.Title = @event.Title;

            await _dao.SaveChangesAsync();
        }
示例#2
0
        public async Task <IHttpActionResult> Get(Guid id)
        {
            var product = await _dao.GetAsync(id);

            return(Ok(product));
        }