public ActionResult ImportDB() { _rep = new YC.Repository.OpenDataRepository(); var datas = _rep.FindFromOpenData(); datas.ToList().ForEach(x => { _rep.Create(x); }); return(Content("OK")); }
static void Main(string[] args) { var t = YC.Shared.Utils.GetDataPath(); //組員1 _rep = new YC.Repository.OpenDataRepository(); var datas = _rep.Find().OfType <YC.Models.OpenData>().ToList(); Console.WriteLine(string.Format("新增{0}筆OpenData:開始", datas.Count)); datas.ForEach(x => { _rep.Create(x); }); Console.WriteLine(string.Format("新增OpenData:結束")); Console.ReadKey(); }