Hi all,

I am using castle with a sqlite database to save serialised objects. I
am using the following code to load the elements.

Code:
public static new DbItem[] FindAll()
        {
            return ActiveRecordBase<DbItem>.FindAll(new Order[]
{ Order.Asc("Name") });
        }


The class DbItem has a String property called XmlTemplate that uses
the database string to serialize the object. To be generic I am using
a plugin system so I'll be able to load additional elements in the
future ( Template.FromXML checks the plugins available and gets the
appropriate template).

Code:
private Template _template ;
 [Property("XmlTemplate")]
        protected string XmlTemplate
        {
            get { return (_template == null) ? null :
_template.ToXmlString(); }
            set { if ((value != null) && (value != string.Empty))
_template  = Template.FromXML(value); }
        }

        /// <summary>
        /// Template used to generate the data
        /// </summary>
        [XmlIgnore]
        public Template Template
        {
            get { return _template; }
            set { if (_template != value) _template = value;}
        }

What happens is FindAll retrieves the data as needed. However if a
plugin is not loaded the template property is set to Null (which is
fine) but the database element get modified.
Could you let me know if there is a way of preventing the data to be
commited to the database ?

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to