public void setObject(object o) { m_dbTableAttr = null; object[] attrs = o.GetType().GetCustomAttributes(typeof(dbTable), false); if (attrs.Length == 0) { throw new ApplicationException("Object doesn't implement dbTable attribute"); } m_dbTableAttr = (dbTable)attrs[0]; m_dbProperties = new Dictionary <string, dbPropertyInfo>(); foreach (PropertyInfo p in o.GetType().GetProperties()) { dbPropertyInfo pi = new dbPropertyInfo(p, o, m_dbFactory); if (pi.isDbProperty) { m_dbProperties.Add(pi.fieldName, pi); } } }
public void setValue(string fieldName, object value) { dbPropertyInfo p = m_dbProperties[fieldName]; p.setValue(value); }