Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a situation where I need to add a property that maps to the column of database table .

I already have an running application with property that maps the database column. example

C#
public virtual string ChocoBarPrice { get; set; }


this maps to the column name choco_bar_price .



Now I need to add another Property that needs to map with column name choco_bar_2_price.



This is what I did , I just added a property but I am not sure if this is right way to do it.


C#
public virtual string ChocoBar2Price { get; set; } 


How do I do it? I would be thankful for the help.

What I have tried:

This is what I did , I just added a property but I am not sure if this is right way to do it.


C#
public virtual string ChocoBar2Price { get; set; } 
Posted
Updated 19-Feb-16 5:53am
v2
Comments
Wonde Tadesse 19-Feb-16 11:57am    
Not clear.Is it EF, ADO.NET, NHibernate, LLBLGen, ... ?
[no name] 20-Feb-16 17:44pm    
I am sorry that i wasn't really clear at my question. it was nhibernate. Thank you for trying to help me out.
Sinisa Hajnal 20-Feb-16 4:07am    
Find the place where other columns map and add it to map. Or refresh EntityModel or do whatever is specific to your setup that reads / writes the model to or from the database.
[no name] 20-Feb-16 17:45pm    
Yes i did it. Thank you. and thanks to Wonde Tadesse for helping me out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900