> The model I've got in my test app has a lot more code for the setter...
> however, it all works. For example, in my test defect database, I've
> got:
> > And was the code you've shown for the association the code created by
> > the LINQ to SQL designer, or was it hand-written?
[quoted text clipped - 10 lines]
> statements through a view, not allowing direct access to the tables,
> and all updates are done via stored procedures
Okay, it may well have something to do with that - I don't know.
> > The model I've got in my test app has a lot more code for the setter...
> > however, it all works. For example, in my test defect database, I've
[quoted text clipped - 3 lines]
> I'm leaving for a few hours, but will be checking back today because
> I'm stuck on this problem.
The setter is quite big - but I wouldn't expect the setter to actually
be called for the entity itself. Do you have a property for the foreign
key, and does that get called?
I would suggest creating a new project and *just* using the LINQ to SQL
designer, and see if that works - then compare the two.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Andy - 14 Mar 2008 17:56 GMT
> The setter is quite big - but I wouldn't expect the setter to actually
> be called for the entity itself. Do you have a property for the foreign
> key, and does that get called?
I wouldn't expect it to matter either. I do have a property for the
FK:
[Column, DataField]
public Int32? CreatedById { get; set; }
> I would suggest creating a new project and *just* using the LINQ to SQL
> designer, and see if that works - then compare the two.
Ok, I'll give that a shot.
Andy - 14 Mar 2008 18:53 GMT
> I would suggest creating a new project and *just* using the LINQ to SQL
> designer, and see if that works - then compare the two.
Ok, I did this, and apparently you MUST specify Storage in the
Association; I guess that's required so that Linq can bypass the
property setter or something. It would be nice if this didn't
silently fail though..
Thanks for your help.
Andy