예제 #1
0
 private void AddOrGetLabelId(SongTagFile songTag, Song song)
 {
     if (songTag.Label != null)
     {
         var label = LabelRepository.Get(x => x.Name == songTag.Label).FirstOrDefault();
         if (label == null)
         {
             song.Label = new Label()
             {
                 Name = songTag.Label
             };
             LabelRepository.Insert(song.Label);
             this.Save();
         }
         else
         {
             song.LabelId = label.Id;
         }
     }
 }