Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing the LINQ to SQL object model

Tags:

c#

linq

Im using vs2008 and Im also using the autogenerated object model / entity classes from linq to sql (.dbml).

Is it possible / recommended to change the autogenerated .cs file. Eg change the behaviour of Equals (in the partical class Courses)?

I do know that Equals should be reflexive, symmetric, transitive, consistent and "Equals(null)== false "

like image 796
Schildmeijer Avatar asked Jul 20 '26 05:07

Schildmeijer


1 Answers

It's not suggested to change the generated file directly as it will be regenerated and overwrite your changes if you edit the DBML. The generated classes will be declared as partial so you can change them by creating another file and declaring a partial class with the same name and adding your changes there.

like image 193
mmx Avatar answered Jul 21 '26 19:07

mmx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!