public static void imgPicker() { var db = new leduInfoDB(); var rootpath = ConfigurationManager.AppSettings["ImgBasePath"]; if (Directory.Exists(rootpath)) { foreach (var item in Directory.GetFiles(rootpath)) { var foo=@item; var filepathInDB = from p in db.ImgPaths where p.Path==foo select p.Path; if (filepathInDB.Any()) { continue; } db.ImgPaths.Add(new ImgPath { Path = item}); } db.SaveChanges(); } }
public SpeicalShow() { leduInfoDB db = new leduInfoDB(); var houseId = from d in db.HouseInfotbl where d.houseID>=0 select d.houseID; }