Ejemplo n.º 1
0
        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()
            });
        }
Ejemplo n.º 2
0
        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()
            });
        }