示例#1
0
        public IModelReference InsertTrack(TrackData trackData)
        {
            var track = new Track
                {
                    Album = trackData.Album,
                    Artist = trackData.Artist,
                    GroupId = trackData.GroupId,
                    ISRC = trackData.ISRC,
                    ReleaseYear = trackData.ReleaseYear,
                    Title = trackData.Title,
                    TrackLengthSec = trackData.TrackLengthSec
                };

            GetCollection<Track>(Tracks).Insert(track);
            return trackData.TrackReference = new MongoModelReference(track.Id);
        }
示例#2
0
 private TrackData GetTrackData(Track track)
 {
     return new TrackData(
         track.ISRC,
         track.Artist,
         track.Title,
         track.Album,
         track.ReleaseYear,
         track.TrackLengthSec,
         new MongoModelReference(track.Id))
         {
             GroupId = track.GroupId
         };
 }