public static EventParticipant AddEventParticipant(Event evt, Participant participant) { var eventParticipant = EventParticipant.NewEventParticipant(); eventParticipant.Event = evt; eventParticipant.Participant = participant; return(eventParticipant); }
/// <summary> /// Add and event Participant /// </summary> /// <param name="participant"></param> /// <remarks> /// Check if the event participant exists. If it does then return the event participant object, otherwise /// create a new event participant object and return it. /// </remarks> /// <returns></returns> public EventParticipant AddEventParticipant(Participant participant) { var eventParticipant = this.EventParticipants.FirstOrDefault(ep => ep.ParticipantID == participant.ParticipantID); if (eventParticipant != null) { return(eventParticipant); } eventParticipant = EventParticipant.AddEventParticipant(this, participant); return(eventParticipant); }
/// <summary> /// Create a new EventParticipant object. /// </summary> /// <param name="eventParticipantID">Initial value of the EventParticipantID property.</param> /// <param name="eventID">Initial value of the EventID property.</param> /// <param name="participantID">Initial value of the ParticipantID property.</param> /// <param name="createdOn">Initial value of the CreatedOn property.</param> /// <param name="modifiedOn">Initial value of the ModifiedOn property.</param> /// <param name="stamp">Initial value of the Stamp property.</param> /// <param name="active">Initial value of the Active property.</param> /// <param name="createdBy">Initial value of the CreatedBy property.</param> /// <param name="modifiedBy">Initial value of the ModifiedBy property.</param> public static EventParticipant CreateEventParticipant(global::System.Int32 eventParticipantID, global::System.Int32 eventID, global::System.Int32 participantID, global::System.DateTime createdOn, global::System.DateTime modifiedOn, global::System.Byte[] stamp, global::System.Boolean active, global::System.Int32 createdBy, global::System.Int32 modifiedBy) { EventParticipant eventParticipant = new EventParticipant(); eventParticipant.EventParticipantID = eventParticipantID; eventParticipant.EventID = eventID; eventParticipant.ParticipantID = participantID; eventParticipant.CreatedOn = createdOn; eventParticipant.ModifiedOn = modifiedOn; eventParticipant.Stamp = stamp; eventParticipant.Active = active; eventParticipant.CreatedBy = createdBy; eventParticipant.ModifiedBy = modifiedBy; return eventParticipant; }
/// <summary> /// Deprecated Method for adding a new object to the EventParticipants EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEventParticipants(EventParticipant eventParticipant) { base.AddObject("EventParticipants", eventParticipant); }
public static EventParticipant NewEventParticipant() { EventParticipant newObject = new EventParticipant(); BsoArchiveEntities.Current.AddToEventParticipants(newObject); BsoArchiveEntities.SetDefaultValue(newObject); return newObject; }