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(); }
public async Task <IHttpActionResult> Get(Guid id) { var product = await _dao.GetAsync(id); return(Ok(product)); }