コード例 #1
0
 internal static ArtistModel FromArtist(Artist artist)
 {
     return new ArtistModel()
     {
         FirstName = artist.FirstName,
         LastName = artist.LastName,
         DateOfBirth = artist.DateOfBirth,
         Country = artist.Country
     };
 }
コード例 #2
0
        internal static Artist ToArtist(ArtistModel artistModel, Artist artist = null)
        {
            if (artist == null)
            {
                artist = new Artist();
            }

            artist.FirstName = artistModel.FirstName;
            artist.LastName = artistModel.LastName;
            artist.DateOfBirth = artistModel.DateOfBirth;
            artist.Country = artistModel.Country;

            return artist;
        }