Beispiel #1
0
        public HttpResponseMessage Post([FromBody] CreateNewCustomer createNewCustomer)
        {
            var aggregateId = Guid.NewGuid().ToString();
            var orderStarted = new OrderStarted
                                            {
                                                AggregateId = aggregateId,
                                                CustomerName = createNewCustomer.CustomerName
                                            };
            _repository.StoreEvent<Order>(HardCodedTenantIdForPoc, orderStarted);

            var response = Request.CreateResponse(HttpStatusCode.Created);

            var uri = Url.Link("DefaultApi", new { id = aggregateId });
            // ReSharper disable AssignNullToNotNullAttribute
            response.Headers.Location = new Uri(uri);
            // ReSharper restore AssignNullToNotNullAttribute
            return response;
        }
Beispiel #2
0
 private void Process(OrderStarted orderStarted)
 {
     CustomerName = orderStarted.CustomerName;
 }