Just starting out with LINQ to SQL (you can probably tell - be gentle).
I'd like to use the value returned by a user-defined function as an entity class property value and have the the value populated when all the other basic (column) fields are loaded.
I know there are ways to use the UDF from a L2S query (here, and here), but I'd prefer to have the value automatically loaded.
For example, I'd expect LINQ to SQL to generate SQL similar to this and populate a property on my User entity class called AssociatedRecordCount with the integer value returned by GetAssociatedRecordCount:
SELECT ID, dbo.GetAssociatedRecordCount(ID) As AssociatedRecordCount
FROM Users
Also, I'm using the Visual Studio LINQ to SQL designer.
Thank you!