Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You may want to use CommunityAttributeBuilder (<a href="https://github.com/Geta/Community.EntityAttributeBuilder" rel="nofollow">https://github.com/Geta/Community.EntityAttributeBuilder</a>) that is similar to PageTypeBuilder for CMS. Currently it's supporting CMS6, I'll commit v7 as soon I will finish testing. By decorating your class properties with special attribute you will find those created in target site.</p> <p>For instance:</p> <pre><code>[CommunityEntity(TargetType = typeof(IUser))] public class UserAttributes : IClubUserAttributes { [CommunityEntityMetadata] public virtual int AccessType { get; set; } [CommunityEntityMetadata] public virtual string Code { get; set; } [CommunityEntityMetadata] public virtual int EmployeeKey { get; set; } [CommunityEntityMetadata] public virtual bool IsAdmin { get; set; } } </code></pre> <p>Library will scan all assemblies and look for types decorated with CommunityEntity attribute, if found one then properties will be scanned and those decorated with CommunityEntityMetadata attribute will be automatically created in DB. It also supports strongly-typed interface over IUser type:</p> <pre><code>var metadata = user.AsAttributeExtendable&lt;UserAttributes&gt;(); metadata.AccessType = info.AccessType; metadata.Code = info.Code; metadata.EmployeeKey = info.EmployeeKey; metadata.IsAdmin = info.IsAdmin; </code></pre> <p>More info about library could be found - <a href="http://world.episerver.com/Blogs/Valdis-Iljuconoks/Dates/2012/6/Community-Attribute-Builder-final/" rel="nofollow">http://world.episerver.com/Blogs/Valdis-Iljuconoks/Dates/2012/6/Community-Attribute-Builder-final/</a></p> <p>More info about internals (if interested) could be found here - <a href="http://www.tech-fellow.lv/2012/06/when-you-need-something-stronger/" rel="nofollow">http://www.tech-fellow.lv/2012/06/when-you-need-something-stronger/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload