private bool load(object data, DbIdentityRecordInfo info) { if (!info.IsPrimaryKeyValid(data)) { throw new NdbException("Primary Key wasn't set for object " + data.GetType()); } return(Load(data, info.PrimaryKey.Name, info.PrimaryKey.GetValue(data))); }
private int update(DbIdentityRecordInfo info, object data) { if (!info.IsPrimaryKeyValid(data)) { throw new NdbException(string.Format( "Primary Key wasn't set for the {0} object", data.GetType())); } return(Accessor.Update(info.TableName, info.GetValues(data), info.PrimaryKey.Name, info.PrimaryKey.GetValue(data))); }
private void save(object data, DbIdentityRecordInfo info) { if (!info.IsPrimaryKeyValid(data)) { insert(info, data); } else { update(info, data); } }