Ok,
So, I have a class library with all my database logic. My DAL/BLL.
I have a few web projects which will use the same database and classes, so I thought it was a good idea to abstract the Data Layer into its own project.
However, when it comes to adding functionality to classes for certain projects I want to to add method to certain classes.
For Example. My Data Layer has Product and SomeItem Objects:
// Data Access Layer project
namespace DAL {
public class Product {
//implementation here
}
public class SomeItem {
//implementation here
}
}
In one Project I want to add an interface that is used by different Content Items, so I have a class called:
// This is in Web Project
namespace DAL {
public partial class Product : ICustomBehaviour {
#region ICustomBehaviour Implementation
TheSharedMethod();
#endregion
}
}
The Question is:
Is this a good idea to write a partial class in a separate project (creating a dependency) using the SAME namespace?
If it's a bad idea, how can I get this type of functionality to work?
It doesn't seem to want to merge them at compile time, so I'm not sure what I'm doing wrong.