I want to create a property on my LINQ To SQL designer-generated class that gets and sets a formatted type, like that:
public partial ALinqClass
{
public string formatedValue
{
get { return formatValue(TheValue); }
set { TheValue = RemoveFormating(value); }
}
}
TheValue is the property generated by the Linq designer.
How do I decorate public string formatedValue so I can bind it to controls on my form?
For example: When I use Visual Studio to create a Object Data Source from my linq object/class all properties linq generated are present on the Object data Source, but formatedValue is not.
Why ?
WHY ?
WHHHHHHHHY ????????!!!!!
Thank you.
Fábio
Linq-to-SQL generated entities are declared as partial classes so you should be able to create another file and add custom properties to the same partial class. This is so if you have to regenerate the classes, your additions to the entities are still available in a different file.
Also as long as these properties are public, you should be able to databind them just like generated properties.