2

So I'm trying something like the following with EntityFramework.Extended:

https://github.com/loresoft/EntityFramework.Extended

context.Logs.Delete(l => l.Id == 216471);

This is the simplest example I can provide.

The problem is this and any other .Delete() I try to do is giving me a:

System.NullReferenceException: Object reference not set to an instance of an object.

I'm using EF 5.0.0 and EF.Extended 5.0.0.73 against an Oracle 11gR2 database.

Any ideas? :)

Cross post on GitHub: http://bit.ly/12Z6xj2

Tod Thomson
  • 4,773
  • 2
  • 33
  • 33
  • `context.Logs` is probably null for some reason. I'm not familiar with EF.Extended, but you may want to look into the context and see if there's some reason it's not being populated with some sort of `DbSet`. – Steven V Aug 07 '13 at 02:16
  • var count = context.Logs.Count(); returns 12731 and select count(*) from log; returns 12731 so I'm sure it's not NULL... And I can enumerate the results set in Visual Studio... etc etc – Tod Thomson Aug 07 '13 at 02:22
  • Just a guess... there is no log with Id == 216471... – StillLearnin Aug 07 '13 at 02:25
  • select * from log where ID = 216471; returns a result, so nope! :D – Tod Thomson Aug 07 '13 at 02:29
  • Did you try the select from EF or some "management studio"? – StillLearnin Aug 07 '13 at 02:34
  • 1
    Full stacktrace on the Exception? I suspect that the reason is that you are using Oracle as opposed to SQL Server or SQL Server CE. – Aron Aug 07 '13 at 04:22
  • The exception is as shown above, there is no InnerException... But I suspect that it's definitely Oracle-related (isn't every problem?). – Tod Thomson Aug 07 '13 at 06:45

1 Answers1

0

try context.Logs.where(l => l.Id == 216471).Delete()

shimron
  • 596
  • 6
  • 19