public JsonDotNetResult Create(CompetitionCreateCommand command) { return ExecuteInExplicitTransaction( action: () => { var competition = new Competition(); competition.Update(command); RavenSession.Store(competition); RavenSession.SaveChanges(); var scheduleCreateCommand = new ScheduleCreateCommand { CompetitionId = competition.Id, Days = competition.Days }; scheduleCreateCommand.CopyCommandPropertiesFrom(command); var schedule = new Schedule(); schedule.Update(scheduleCreateCommand); RavenSession.Store(schedule); RavenSession.SaveChanges(); var url = Url.Action("Details", "Competition", new {id = competition.Id.ForMvc()}); return new JsonDotNetResult(url); }); }
public CompetitionDataIndexViewModel(Schedule schedule , Competition competition , IEnumerable<Level> levels , IEnumerable<Division> divisions , IEnumerable<Gym> gyms , IEnumerable<Registration> registrations , IEnumerable<Performance> performances ) { Schedule = schedule; Competition = competition; Levels = levels; Divisions = divisions; Gyms = gyms; Registrations = registrations; Performances = performances; ScoringMap = new ScoringMap(); }