Exemplo n.º 1
0
 public void GetAllPersons(int authorId)
 {
     using (var context = new MusicAppDb())
     {
         context.Authors.ToList().Select(x => AuthorDTO.FromEntity(x)).ToList().ForEach(x => Console.WriteLine(x.FullName));
     }
 }
Exemplo n.º 2
0
 public AuthorDTO GetAuthorByName(string fullName)
 {
     using (var context = new MusicHubDb())
     {
         return(context.Authors.Include("Songs").Where(x => x.FullName == fullName).ToList().Select(y => AuthorDTO.FromEntity(y)).FirstOrDefault());
     }
 }