views:

38

answers:

2

New to SubSonic, inherited it with a project that uses SubSonic 2.2.1 I have tried to added a column to one of my tables and run the tool to update the classes, The table name is Feedback and Feedback.cs added the new property but VFeedback.cs didn't, am I missing something?

A: 

VFeedback.cs might be partial cousin of your generated Feedback.cs class or it may be different class containing business logic etc.

TheVillageIdiot
So should I just use Feedback for my query? VFeedback looks like is a read only (select) class not insert/update in it.Any idea on how to force it to take the new field?
saarpa
As I suspect it might be custom (hand crafted) file. if you can show some code from VFeedback.cs then I might be able to help you.
TheVillageIdiot
A: 

By default, given a table named Feedback, SubSonic will generate Feedback.cs and FeedbackController.cs. VFeedback.cs sounds like something non-standard to SubSonic.

I'm guessing the person you inherited this project from is gone (else I would ask him first), so this is what I would look at:

  • I'm guessing you have more than 1 table in your database and corresponding generated files for each of your tables.
    • Do you have a corresponding V.cs class for each of the tables/generated files?
    • Do the V.cs files look more or less the same structure (i.e. like it was also generated)?
    • If the answer is yes to the last two questions, my guess is that your predecessor modified the default subsonic template files to output additional generated files (to add some custom behavior he needed). If not, maybe he wrote VFeedback.cs as a one off file.
  • Are you using the default SubSonic code/binaries from the SubSonic site or ones that you inherited?
    • If you are using SubSonic code/binaries that you inherited and running the tool did not generate a new VFeedback.cs, I'd guess it's a one off file.
  • Rollback your Feedback table to what you inherited from your predecessor. Run SubSonic (the default one you can download from the site) to generate a new Feedback.cs. Diff the old and new Feedback.cs files and see if you get the same thing. It'll give you an idea if your predecessor made custom modifications to SubSonic.
sparks
This is so embarrassing, vFeedback is a view! Can't believe i didn't look there before asking. I was so sure it's a subsonic thing that I didn't stop to think that if the classes regenerate when i run the DAL it must be something in the DB. Thank you guys, sorry for waste of time.
saarpa