2
Vote

Insert statement and read-only properties

description

If you define a property in the mapping class as read-only by creating only its getter it will discard the data when inserting a new item in the database. The data of the property will be NULL in the insert statement.
 
ex.
public string Name { get; set; }
public int TypeId { get; }
 
will result in
 
INSERT INTO TestTable(Name, TypeId) VALUES ('Tester', NULL)

comments