public override void Insert(IDictionary values, DataSourceViewOperationCallback callback) { try { ISoodaObjectFactory fact = SoodaTransaction.ActiveTransaction.GetFactory(_owner.ClassName); SoodaObject obj = fact.CreateNew(SoodaTransaction.ActiveTransaction); Type type = obj.GetType(); foreach (DictionaryEntry v in values) { PropertyInfo pi = type.GetProperty((string)v.Key, BindingFlags.Public | BindingFlags.Instance); if (pi == null) { throw new SoodaException(v.Key + " not found in " + type.FullName); } pi.SetValue(obj, v.Value, null); } callback(1, null); } catch (Exception ex) { callback(0, ex); } }
private SoodaObject GetNewObject(ISoodaObjectFactory factory) { return factory.CreateNew(this); }
private SoodaObject GetNewObject(ISoodaObjectFactory factory) { return(factory.CreateNew(this)); }