コード例 #1
0
 public SeedlingDTO GetSeedlingById(int id)
 {
     using (var context = new PlantAppContext())
     {
         return(context.Seedlings.Where(x => x.Id == id).ToList().Select(x => SeedlingDTO.FromEntity(x)).FirstOrDefault());
     }
 }
コード例 #2
0
 public List <SeedlingDTO> GetAllSeedlings()
 {
     using (var context = new PlantAppContext())
     {
         var seedlings = context.Seedlings.ToList().Select(x => SeedlingDTO.FromEntity(x)).ToList();
         return(seedlings);
     }
 }