public WheelConfiguration CreateWheelConfig(WheelConfigurationBindingModel model, string userId) { var wheel = _wheelConfigurationRepo.CreateWheelConfig(userId); if (wheel == null) { throw new Exception("Wheel config could not be created"); } foreach (var s in model.Slices) { s.WheelConfiguration = wheel; _wheelConfigurationSliceRepo.CreateSlice(s); } return(wheel); }
public WheelConfigurationViewModel AddWheelConfiguration(WheelConfigurationBindingModel model) { var userId = HttpContext.Current.User.Identity.GetUserId(); return(TransformModels.ToWheelConfigurationViewModel(_wheelService.CreateWheelConfig(model, userId))); }