Generation of feature-, field- and content type ids as static class

Apr 7, 2011 at 3:00 PM

Just an idea that came to my mind ...

Often inside the code you need to directly access the field-GUID (or name or the content-type id). So one would be more productive if the available ids would be generated into a "resource class". So you can access the field like so

// Access via GUID
listItem[Company.Project.Contants.Fields.ProjectName_Id];
// Access via StaticName
listItem[Company.Project.Contants.Fields.ProjectName];

// Example for ContentType
web.ContentTypes[Company.Project.Constants.ContentTypes.Project]

Perhaps this could be achived via T4 templating within Visual Studio or during creation of Site Columns / ContentTypes.

Any suggestions?

Coordinator
Apr 11, 2011 at 6:56 AM

Good idea. We can provide this Resourcefile very easy. I will put in on the list for the next release. :)

Thank you!

Coordinator
Apr 19, 2011 at 4:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.