public void CreateTestRide(string accessKey, int bikeId) { User user = userManager.GetUserByAccessKey(accessKey); if (user == null) { userManager.AddUser(new User { AccessKey = accessKey }); } var testRide = new TestRide { Bike = new Bike { Id = bikeId }, UserId = accessKey, Date = DateTime.Now, Number = Guid.NewGuid().ToString() }; testRideRepository.AddTestRide(testRide); }
public IHttpActionResult Post([FromBody] TestRide testRide) { testRideManager.CreateTestRide(testRide.UserId, testRide.BikeId); return(Ok()); }