c# - Access modifier for default constructor in LINQ2SQL generated classes -



c# - Access modifier for default constructor in LINQ2SQL generated classes -

just origin linq2sql here , have few questions.

i have db single table customer, run sqlmetal , generates orm class me.

i'd apply rules in constructor of customer, maybe firstname, lastname members of client have supplied.

i created new constructor in sqlmetal generated client class take 2 parameters firstname, secondname , marked default parameterless constructor internal don't want expose whatever consumes assembly.

my code began complain when tried submitchanges() because of new protection level of parameterless constructor public internal.

list<customer> customerlist = new list<customer>(); customerlist = dbinstance.customer.tolist(); client customertodelete = customerlist.where(c => c.customer_id == 100).first(); dbinstance.customer.deleteonsubmit(customertodelete); dbinstance.submitchanges(); <-- error thrown

"no parameterless constructor defined object"

why must access modifier public on default constructor in client orm class? when public works expected.

linqtosql generates partial classes, can utilize that. not edit generated files. lose changes after updating model.

c# linq-to-sql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -