Any Problem with Using #Regions in MacroMethodContainer Extension Class?

kentico guy asked on March 6, 2020 16:04

This is a really quick and easy question:

Are region tags allowed to be used in an extended MacroMethodContainer class ? I noticed that our vendor didn't put any of the methods into regions and it looks like this deviates from their general design pattern. I thought regions got discarded at compile, and we're running version 12.0.15, which is a fully compiled webapp, so unless this particular file is JIT (for some reason) ... it shouldn't matter at all... but I still would like to confirm whether I can use regions in this extension class or not.

thanks!

Recent Answers


Dmitry Bastron answered on March 6, 2020 16:20

Hi,

Well... I have never heard of restricting usage of regions in .cs files. It should be fine to use regardless Kentico version. Just to be clear, do you mean C# regions?

#region MyRegion

// some code

#endregion
2 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 6, 2020 16:28

No issues at all with using #region markup code in C# with Kentico

1 votesVote for this answer Mark as a Correct answer

kentico guy answered on March 6, 2020 16:46

Ok, yeah I was 99.9999% sure mostly just checking because it didn't follow their usual design patterns, maybe they just didn't have time to sort them.

Thanks for the responses

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.