예제 #1
0
 public void ManualConfiguration(IProfileExpression cfg)
 {
     cfg.CreateMappings((Song m) => new ClementineSong
     {
         Title            = m.Title,
         Album            = m.Album != null ? m.Album.Name : "",
         Artist           = m.Artist != null ? m.Artist.Name : "",
         Track            = m.TrackNumber,
         Disc             = m.DiscNumber,
         Bpm              = -1,
         Year             = m.Album != null ? m.Album.Year : 0,
         Compilation      = 0,
         Length           = m.ID3Tag.DurationInSeconds * (uint)1000000000,
         Bitrate          = m.ID3Tag.BitRate,
         SampleRate       = m.ID3Tag.SampleRate,
         Directory        = 999,
         Filename         = m._filepath.ToHexString(),
         ModificationTime = m.FileInformation != null ? (long)m.FileInformation.LastWriteTimeUtc.ToUnixEpoch().TotalSeconds : 0,
         CreationTime     = m.FileInformation != null ? (long)m.FileInformation.CreationTimeUtc.ToUnixEpoch().TotalSeconds : 0,
         Filesize         = m.FileInformation != null ? m.FileInformation.Length : 0,
         Filetype         = m.FileInformation != null
                    ? EnumHelper.GetAudioTypeFromExtension(m.FileInformation.Extension).HasValue
                         ? (int)EnumHelper.GetAudioTypeFromExtension(m.FileInformation.Extension).Value.GetMusicLibraryFileTypeValue(MusicLibrary.Clementine)
                         : 0
                    : 0,
         LastPlayed            = -1,
         Rating                = -1,
         ForcedCompilationOn   = 1,
         EffectiveCompilation  = 1,
         EffectiveAlbumArtist  = m.Artist != null ? m.Artist.Name : "",
         Grouping              = "",
         OriginalYear          = -1,
         EffectiveOriginalYear = -1
     });
 }
 public void ManualConfiguration(IProfileExpression cfg)
 {
     cfg.CreateMappings((TestEntityA x) => new TestEntityB
     {
         Number    = x.Id,
         Username  = x.Name,
         Code      = x.ComplexProp != null ? x.ComplexProp.Code : Guid.Empty,
         CodePrice = x.ComplexProp != null ? (double)x.ComplexProp.Value : default(double)
     });
 }
 public void ManualConfiguration(IProfileExpression cfg)
 {
     cfg.CreateMappings((TestEntityB x) => new TestEntityA
     {
         Id          = x.Number,
         Name        = x.Username,
         ComplexProp = new TestEntityC
         {
             Code  = x.Code,
             Value = (decimal)x.CodePrice
         }
     });
 }