Esempio n. 1
0
        public Task <RegisterBike.Response> PostBike([FromBody] RegisterBike.Request request)
        {
            Guid id;

            using (var session = store.OpenSession())
            {
                var bike = Bike.Create(request.FrameNumber);
                session.Store(bike);
                id = bike.Id;
                session.SaveChanges();
            }
            return(Task.FromResult(new RegisterBike.Response()
            {
                Id = id
            }));
        }