Using a part of a class in multiple projects

Posted by Axarydax on Stack Overflow See other posts from Stack Overflow or by Axarydax
Published on 2010-04-23T06:49:43Z Indexed on 2010/04/23 6:53 UTC
Read the original article Hit count: 175

Filed under:
|
|

I have a set of methods that do some utility work over SQL connection, and until now these have been copied over from project to project. But as time goes on, project numbers have grown and I need to keep these methods in sync in case I find a bug or need to update it.

I have managed to get it to the state that SQL access class is a partial class, one part is specific for project and contains wrappers for a specific database. The second part is the common one and contains methods that are used in all project-specific databases.

The problem is that now I would have the "utility" class copied over 8 projects, with the same content, but in different namespaces. In C/C++ it would have been simple, because I would just have #included the contents of the file wherever needed. What should I do in C#?

© Stack Overflow or respective owner

Related posts about partial-classes

Related posts about refactoring