Ejemplo n.º 1
0
        public IEnumerable <Artist> GetAll()
        {
            return(_unitOfWork._firstGenUnitOfWork.Parties.AsNoTracking().ToList()
                   .Join(_unitOfWork._secondGenUnitOfWork.Persons.AsNoTracking().ToList(), party => party.Id, person => person.Id,
                         (party, person) => InheritanceConstructor.ReConstructPerson(party, person))

                   .Join(_unitOfWork._thirdGenUnitOfWork.Artists.Include(a => a.ArtistDetails).Include(a => a.ArtistTracks).AsNoTracking().ToList(), person => person.Id, artist => artist.Id,
                         (person, artist) => InheritanceConstructor.ReconstructArtist(person, artist)).OrderBy(a => a.Id));
            //   .Join(_unitOfWork._secondGenUnitOfWork.Tracks.AsNoTracking().ToList(), track => track.Id));
        }
Ejemplo n.º 2
0
        public Artist Get(long id)
        {
            var artist = _unitOfWork._thirdGenUnitOfWork.Artists.Where(a => a.Id == id).Include(a => a.ArtistDetails).Include(a => a.ArtistTracks).FirstOrDefault();

            if (artist != null)
            {
                var party  = _unitOfWork._firstGenUnitOfWork.Parties.Where(p => p.Id == id).FirstOrDefault();
                var person = _unitOfWork._secondGenUnitOfWork.Persons.Where(p => p.Id == id).FirstOrDefault();

                person = InheritanceConstructor.ReconstructPerson(party, person);
                artist = InheritanceConstructor.ReconstructArtist(person, artist);

                return(artist);
            }

            return(null);
        }
Ejemplo n.º 3
0
 public IEnumerable <Person> GetAll()
 {
     return(_unitOFWork._firstGenUnitOfWork.Parties.AsNoTracking().ToList()
            .Join(_unitOFWork._secondGenUnitOfWork.Persons, party => party.Id,
                  person => person.Id, (party, person) => InheritanceConstructor.ReConstructPerson(party, person)));
 }