Inheritance: DbContext
コード例 #1
0
        public List<AppTO> findAll()
        {
            List<AppTO> appsTO = new List<AppTO>();
            using (wamEntities db = new wamEntities())
            {
                var apps = from app in db.Application
                           select app;

                foreach (var app in apps)
                {
                    AppTO appTO = new AppTO();
                    appTO.name = app.name;
                    appTO.id = app.Id;
                    appsTO.Add(appTO);
                }
            }
            return appsTO;
        }
コード例 #2
0
        public List <AppTO> findAll()
        {
            List <AppTO> appsTO = new List <AppTO>();

            using (wamEntities db = new wamEntities())
            {
                var apps = from app in db.Application
                           select app;

                foreach (var app in apps)
                {
                    AppTO appTO = new AppTO();
                    appTO.name = app.name;
                    appTO.id   = app.Id;
                    appsTO.Add(appTO);
                }
            }
            return(appsTO);
        }