How can I update an object without selecting a record.
For example,
[ActiveRecord(Lazy=true)]
public class AdminUser
{
...
}
using (var sess = new Castle.ActiveRecord.SessionScope())
{
var user =
Castle.ActiveRecord.ActiveRecordMediator<Domain.AdminUser>.FindByPrimaryKey(11);
//
not yet select
user.Username = "Admin"; //select from database
System.Console.WriteLine("SET");
System.Console.ReadLine();
Castle.ActiveRecord.ActiveRecordMediator<Domain.BaseUser>.Save(user); //
update to database
}
System.Console.WriteLine("OK");
System.Console.ReadLine();
I don't want the code to select from database everytime I set value to
a property, since it effects the performance of the application, how
can I write the code to just update only some property and leave those
remaining untouched?
--
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.