tags:

views:

46

answers:

0

I have a view:

SELECT     dbo.Theme.ThemeID, dbo.ThemeObject.XLocation, dbo.ThemeObject.YLocation, dbo.ThemeObject.ThemeElementTypeID AS ThemeObject_ThemeElementTypeID, 
                  dbo.ThemeImage.ThemeImageData
FROM         dbo.Theme INNER JOIN
                  dbo.ThemeObject ON dbo.Theme.ThemeID = dbo.ThemeObject.ThemeID LEFT OUTER JOIN
                  dbo.ThemeImage ON dbo.ThemeObject.ThemeObjectID = dbo.ThemeImage.ThemeObjectID
WHERE     (dbo.ThemeObject.IsDeleted = 0 OR
                  dbo.ThemeObject.IsDeleted IS NULL) AND (dbo.ThemeImage.IsDeleted = 0 OR
                  dbo.ThemeImage.IsDeleted IS NULL) AND (dbo.Theme.IsDeleted = 0)

My problem here is that not all ThemeObjects will have an image (thus the outer join). Linq doesn't recognize this and doesn't tell the generator to allow nulls in the column thus causing a crash if we don't manually set that column to allow nulls every time.

This is the only view that seems to do this and I can't figure out why.

Other than manually configuring the column in the designer after every recreation of the DAL (I sometimes delete all tables and views and re-drop them because of subtle changes that mysteriously don't find their way back in here when they occur... but getting that person to keep up with it is beyond my control) -- is there something I can adjust to either get it to generate it correctly or tell it to alter the output? Or some kind of override I'm not aware of that I can use?