示例#1
0
 public Artist GetArtistById(int id)
 {
     using (var context = new ChinookEntities())
     {
         var result = context.GetArtistById(id);
         var items  = from item in result
                      select new Artist
         {
             ArtistId = item.ArtistId,
             Name     = item.Name
         };
         return(items.FirstOrDefault());
     }
 }