Attributes in EPiServer Relate+ is an easy way of extending classes without having to do it programmatically. In order to assign an attribute to an object, the object has to implement the IAttributeExtendableEntity interface and to everyone’s joy most objects in Relate+ do.
An option to clearing the cache manually is to use the overload of GetQueryResult(...) where you can specify a cache timeout for the query.
Great post! Just what I needed! Thanks!
I wonder if you have any idea whether this would be a better choice to implement custom user fields in a bigger web application OR the standard asp.net profile (System.Web.Profile.ProfileBase)?
I'm thinking in terms of performance / scalability - e.g. if you have 1000 or 10 000 users?
In a recent project (http://www.fk-world.com) I've used the attributes in Relate+ rather than standard asp.net profile without noticing any performance issues. The site has approximately 5000 users, and it works like a charm!
The reason I chose attributes instead of asp.net profile was mainly development time and searchability. Not having to extend the User class programatically saved me a lot of time compared to what extending the ProfileBase class would. The reason for this is the Relate+ query system which I would have to 'recreate' myself if I extended ProfileBase.
But then on the other side, the attributes are not very customizable. So if you need to do a lot of data processing before displaying the data, ProfileBase might have an advantage.
Thank you very much. That's perfect, we're also expecting a user number around <=5000 so it's great to hear it works well!
The searchability is a good point too but so far it's not a requirement. Maybe I could promote the idea now :) But you're right, I should give them a chance and I will!