Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQ to SQL Designer Bug

Tags:

sql

linq

Every time that I change a value in the designer after saving it, the .designer.cs file will be deleted.

Can anyone tell me how can I fix this problem?

like image 782
mrtaikandi Avatar asked Nov 15 '08 13:11

mrtaikandi


3 Answers

Move using directives in your DataContext.cs and DataContext.designer.cs files into the namespace scope.

like image 120
gius Avatar answered Nov 04 '22 19:11

gius


The *.designer.cs files are completely generated by designer. You should not write any your own code into this file. The classes and/or methods are partial, so you can extend/change the behaviour in the separate file.

like image 35
TcKs Avatar answered Nov 04 '22 18:11

TcKs


Don't place your own code in the designer file, instead use a separate file leveraging the partial classes concept.

like image 7
FlySwat Avatar answered Nov 04 '22 19:11

FlySwat