public static EventArtist AddEventArtist(Event evt, Artist artist, Instrument instrument)
        {
            var eventArtist = EventArtist.NewEventArtist();

            eventArtist.Event      = evt;
            eventArtist.Artist     = artist;
            eventArtist.Instrument = instrument;
            return(eventArtist);
        }
Beispiel #2
0
        /// <summary>
        /// Add an event artist
        /// </summary>
        /// <param name="artist"></param>
        /// <param name="instrument"></param>
        /// <remarks>
        /// Check if the event artist exists. If it does then return the event artist object, otherwise
        /// create a new event artist object and return it.
        /// </remarks>
        /// <returns></returns>
        public EventArtist AddEventArtist(Artist artist, Instrument instrument)
        {
            var eventArtist = this.EventArtists.FirstOrDefault(ea => ea.ArtistID == artist.ArtistID && ea.InstrumentID == instrument.InstrumentID);

            if (eventArtist != null)
            {
                return(eventArtist);
            }

            eventArtist = EventArtist.AddEventArtist(this, artist, instrument);

            return(eventArtist);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the EventArtists EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventArtists(EventArtist eventArtist)
 {
     base.AddObject("EventArtists", eventArtist);
 }
 /// <summary>
 /// Create a new EventArtist object.
 /// </summary>
 /// <param name="eventArtistID">Initial value of the EventArtistID property.</param>
 /// <param name="eventID">Initial value of the EventID property.</param>
 /// <param name="artistID">Initial value of the ArtistID 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>
 /// <param name="instrumentID">Initial value of the InstrumentID property.</param>
 public static EventArtist CreateEventArtist(global::System.Int32 eventArtistID, global::System.Int32 eventID, global::System.Int32 artistID, global::System.DateTime createdOn, global::System.DateTime modifiedOn, global::System.Byte[] stamp, global::System.Boolean active, global::System.Int32 createdBy, global::System.Int32 modifiedBy, global::System.Int32 instrumentID)
 {
     EventArtist eventArtist = new EventArtist();
     eventArtist.EventArtistID = eventArtistID;
     eventArtist.EventID = eventID;
     eventArtist.ArtistID = artistID;
     eventArtist.CreatedOn = createdOn;
     eventArtist.ModifiedOn = modifiedOn;
     eventArtist.Stamp = stamp;
     eventArtist.Active = active;
     eventArtist.CreatedBy = createdBy;
     eventArtist.ModifiedBy = modifiedBy;
     eventArtist.InstrumentID = instrumentID;
     return eventArtist;
 }
        public static EventArtist NewEventArtist()
        {
            EventArtist newObject = new EventArtist();

            BsoArchiveEntities.Current.AddToEventArtists(newObject);
            BsoArchiveEntities.SetDefaultValue(newObject);
            return newObject;
        }