public static Domain.Artist ToDomain(this CrossCutting.TransferObjects.Artist TransferObject) { return(new Domain.Artist { Id = TransferObject.Id, Name = TransferObject.Name, Type = TransferObject.Type, Description = TransferObject.Description, Country = TransferObject.Country, Albums = TransferObject.Albums.Select(a => a.ToDomain()).ToList() }); }
public static Entities.Artist ToEntity(this CrossCutting.TransferObjects.Artist TransferObject) { if (TransferObject is null) { throw new ArgumentNullException(nameof(TransferObject)); } return(new Entities.Artist { ArtistId = TransferObject.Id, Name = TransferObject.Name, Description = TransferObject.Description, Country = TransferObject.Country, Type = TransferObject.Type, Albums = TransferObject.Albums?.Select(a => a.ToEntity()).ToList() }); }