asp.net mvc - Best practice to inactivate records from database -



asp.net mvc - Best practice to inactivate records from database -

i have 2 table in database

1.producttype 2.product user can set isactive = false in table. want user cannot set isactive=false in producttypetable if producttypeid used in product table. best practice. working in asp.net mvc 4

try create constructor method in model , set value of attribute false, this:

public class producttype { public producttype() { isactive = false; } public int id { get; set; } public int isactive { get; set; } }

when instance class, false, can set after too. in create method, don't set attribute isactive

asp.net-mvc database

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -