Automatic Schema Validation using NHibernate/ActiveRecord

Posted by Krembo on Stack Overflow See other posts from Stack Overflow or by Krembo
Published on 2009-08-28T20:18:50Z Indexed on 2010/03/31 21:03 UTC
Read the original article Hit count: 362

Hi,
let's assume I have a table of Products with columns: Id, Name, Price and using NHibernate (or ActiveRecord) I map the table to the POCO:


public class Product
{
public virtual long Id { get; set; }
public virtual string Name { get; set; }
public virtual double Price { get; set; }
}

Now if someday a new column named ShipmentPrice (let's assume it's double too) will be added to the Products table, is there any way I can automatically know that. For saying automatically I mean adding code to do that or getting an exception? (I assume I don't have control on the columns of the table or a way to know of any changes to the table's schema in advance)

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about castle-activerecord