var rating = db.BMS_RATG_EVNT_HST.FindAll(db.BMS_RATG_EVNT_HST.BRKEY == m_sBrKey).OrderByDescending(db.BMS_RATG_EVNT_HST.RATG_EVNT_ID).FirstOrDefault().RATG_EVNT_ID;
i know the db is null for the specific item i am looking for-- i need to make this connection so i can insert into the db. the reason for the long query string is because it has to look for the history of the events and if there is some show them in an update else it will insert into the table---
however i get the above error when the table is blank for the brkey id
does anyone know a way to fix this?