2

I have no clue where to put the following class and I've noticed I just keep putting them in a helpers folder which isn't much helpfull towards reusability in future projects.

Example: I want to have the ability to use the DisplayNameAttribute together with resource files. In order for this to work I made a LocalizedDisplayNameAttribute which inherits the ´DisplayNameAttribute´ and adds the following properties DisplayNameResourceName and DisplayNameResourceType.

In which namespace/location would you place such a class which is likely to be reused in future projects?

  • 1
    I think this would be more appropriate if it were asked on StackOverflow.com – Walter Nov 4 '10 at 12:48
  • Over there I got the following warning after entering this same title: The question you're asking appears subjective and is likely to be closed. – Peter Nov 4 '10 at 14:20
2

I think the best way to do this is putting all helper classes and methods in a separate project, and then reference this project in each solution you create. Much easier than copying folders from place x to place y.

This project with all kinds of extensions, helpers etc, can be called something like "Company.Core", or similar.

Example (your attributes):

using Company.Core.Attributes;

// ....

[LocalizedDisplayNameAttribute.DisplayNameResourceName("ResourceName"),
...]
public string Example { get; set; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.