public long CheckAppId(string appname) { var reg = ApplicationsIds.FirstOrDefault(x => x.AppName == appname); if (reg != null) { return reg.Id; } else { // create new appid var apps = new Applications(); long newId = (long)apps.Insert(new { AppName=appname}); ApplicationsIds.Add(new { Id = newId, AppName = appname }); return newId; } }
public SQLiteDataAccess() { var tb=new Applications(); ApplicationsIds = tb.All().ToList(); }