To Convert a DAC Item to a Code Item
If you have a customized data access class that is added to the project as a DAC item, then you can convert the class changes into the class extension code (a Code item) to complete the extension development in the Code Editor or in Microsoft Visual Studio. (See Supported DAC Extension Formats for details.)
To do this, perform the following actions:
- Open the customization project in the Customization Project Editor. (See To Open a Project for details.)
- Click Data Access in the navigation pane to open the Customized Data Classes page.
- In the page table, select the item to be converted, as the screenshot below shows.
- On the page toolbar, click Convert to Extension.CAUTION: This action can be applied for only data access classes customized using the technology based on extensions. If you have legacy DAC customization, upgrade it before converting DAC items to class extensions. See To Upgrade Technology for Legacy DAC Customization for details.
This operation is irreversible. After you convert the XML data to C# code, you will not be able
to work with the item in the Data Class Editor or convert it back to a DAC item. You
will be able to edit the code in Code Editor and Visual Studio.
Attention: The
Convert to Extension action also affects all the inherited classes
of the specified DAC if the classes are customized.
The system obtains the name of the
Code item from the DAC name by appending the Extensions suffix to it. After
the publication of the customization project, the actual customization code of the class is
available in the <DACName>Extensions.cs file in the
App_RuntimeCode folder of the website. For example, if you apply the
action to the CR.Contact class, as shown in the screenshots above, the
operation converts the DAC item to the Code item, automatically giving it the
name of ContactExtensions. The action removes the
CR.Contact
DAC item class from the project and adds the ContactExtensions
Code item.