/// <summary> /// Create a new EventTypeOption object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="eventTypeID">Initial value of the EventTypeID property.</param> /// <param name="eventOptionID">Initial value of the EventOptionID property.</param> public static EventTypeOption CreateEventTypeOption(global::System.Guid id, global::System.Guid eventTypeID, global::System.Guid eventOptionID) { EventTypeOption eventTypeOption = new EventTypeOption(); eventTypeOption.ID = id; eventTypeOption.EventTypeID = eventTypeID; eventTypeOption.EventOptionID = eventOptionID; return eventTypeOption; }
/// <summary> /// Deprecated Method for adding a new object to the EventTypeOptions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEventTypeOptions(EventTypeOption eventTypeOption) { base.AddObject("EventTypeOptions", eventTypeOption); }
private void EventTypeOptionOnPropertyChanged(object sender, PropertyChangedEventArgs e) { IsDirty = true; var option = sender as EventOptionModel; if (e.PropertyName == "IsChecked") { if (option.IsChecked) { var eventTypeOption = new EventTypeOption() { ID = Guid.NewGuid(), EventTypeID = SelectedEventType.EventType.ID, EventOptionID = option.EventOption.ID }; _adminDataUnit.EventTypeOptionsRepository.Add(eventTypeOption); } else { var eventTypeOption = SelectedEventType.EventType.EventTypeOptions.FirstOrDefault(x => x.EventOptionID == option.EventOption.ID); _adminDataUnit.EventTypeOptionsRepository.Delete(eventTypeOption); } SaveChangesCommand.RaiseCanExecuteChanged(); } }