[RESOLVED] Using LINQ with a changing SQL database
I'm planning on using LINQ for the DAL, replacing sql connections etc. I've been reading up and it seems to rely on generated classes which are generated by looking at the makeup of a database.
Lets say that i have a table with a field that is not used any more, but is still in the table when i generate the LINQ classes. I then build my application, which doesn't make use of this field, but it is in the generated class.
Once the application's been deployed we refactor the database a bit, and remove this unused field. Would the app break if i don't re-generate the classes and re-deploy?
Likewise, is it easy to add a database field, and re-generate the class so it can be used in the app?
Cheers for any help!
Re: Using LINQ with a changing SQL database
Quote:
Originally Posted by
SLH
I'm planning on using LINQ for the DAL, replacing sql connections etc. I've been reading up and it seems to rely on generated classes which are generated by looking at the makeup of a database.
Lets say that i have a table with a field that is not used any more, but is still in the table when i generate the LINQ classes. I then build my application, which doesn't make use of this field, but it is in the generated class.
Once the application's been deployed we refactor the database a bit, and remove this unused field. Would the app break if i don't re-generate the classes and re-deploy?
Likewise, is it easy to add a database field, and re-generate the class so it can be used in the app?
Cheers for any help!
Hi,
Yes, I believe it would break, Even if you manage to get away with it its very easy with LINQ to re-generate the classes' its all done behind the scenes and will involve you dragging and dropping on a window :)
Hope that provides some insight.
Re: Using LINQ with a changing SQL database
Cheers for the reply Pino.
Shame i'd need to go through any apps and re-deploy if we change something like this.
Guess it's to be expected though and not a big deal.
I'll mark this resolved, unless anyone has anything else to add.