This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
uow.Add(simpleEntity) throws a null reference exception from: Mindscape.LightSpeed.Entity.GeneratedId() working against sql server, KeyTable Id. |
|
|
Exception dump is: {"Object reference not set to an instance of an object."} LS model is: <?xml version="1.0" encoding="utf-8"?> |
|
|
Exception dump is: {"Object reference not set to an instance of an object."} LS model is: <?xml version="1.0" encoding="utf-8"?> |
|
|
Could you post a stack trace and a repro please? Thanks! |
|
|
There is a stack trace (obfuscated) in the exception dump. The repro on my machine (Vista, VS 2008, SQL Express .dbo, ls 2 or3 doesn't matter) is a trivial entity creation. |
|
|
Oops, sorry, missed that (we seem to be having some issues with the forums software). It looks from the stack trace like UnitOfWork.Context isn't set. Make sure to create your unit of work using LightSpeedContext.CreateUnitOfWork, rather than new-ing it up directly; or if you do need to new it up directly, make sure to set the Context property before using it. |
|