Is it possible to add a custom property in the designer and have it not bound to a column? I fiddled with the settings a bit settled on making a partial class with the property. Is there a way to show this field in the ORM designer?
+1
A:
In the Designer, right click on the Object Properties header and Add => Property.
hunter
2009-05-12 00:27:48
This results in a SqlException: "Invalid column name {MyColumnName}"
blu
2009-05-12 00:33:10
whoops, forgot this: Add this attribute to the Property in the designer.cs file.[Column(IsDbGenerated=false)]
hunter
2009-05-12 00:43:46
You should probably just make this Propertypublic string PropertyName { get; set; }you'll have to do this each time you rebuild your DBML, but you'll get the ORM Designer showing the Property like you wanted.
hunter
2009-05-12 00:46:28
yeah I realized the attribute will be overwritten. Looks like I will just use the partial class.
blu
2009-05-12 00:53:33
+1
A:
The LINQ-to-SQL designer is maintaining the mapping. Unmapped properties need to go in a separate partial class.
Marc Gravell
2009-05-12 04:01:22