public int Update(TnfProperty tnfProperty) { return(Update(new object[] { tnfProperty.Oid, tnfProperty.PropertyObjectOid, tnfProperty.ValidFrom?.Date, tnfProperty.ValidTo?.Date, AttributeValuesToXmlString(tnfProperty.AttributeValues) })); }
public void Add(TnfProperty tnfProperty) { Add(new object[] { tnfProperty.Oid, tnfProperty.PropertyObjectOid, tnfProperty.ValidFrom?.Date, tnfProperty.ValidTo?.Date, AttributeValuesToXmlString(tnfProperty.AttributeValues) }); }
private static TnfProperty ReadProperty(IDataRecord reader) { var tnfProperty = new TnfProperty(); tnfProperty.Oid = reader["oid"].FromDbString(); tnfProperty.PropertyObjectOid = reader["property_object_oid"].FromDbString(); tnfProperty.ValidFrom = reader["valid_from"].ToDateTime(); tnfProperty.ValidTo = reader["valid_to"].ToDateTime(); string attributeValuesXml = reader["attribute_values"].ToString(); tnfProperty.AttributeValues = Serializer.Deserialize(new XmlTextReader(new StringReader(attributeValuesXml))) as TnfAttributes; return(tnfProperty); }