I am working on a C # .NET solution with many reusable assemblers. Three of them:
- WinForms assembly
- webclient class library
- assembly containing data model classes
I have a general method in a class library as such:
namespace Company.WebClient { public class GetData<T>() { ... } }
However, when I call the method from the WinForms assembly, I pass in a type that the class library will not know, because it is contained in the data model assembly:
namespace Company.WinFormsApp { public class App { public void Main() { Company.WebClient.GetData<TypeFromTheDataModel>(); } } }
Surprisingly, it seems to work. But why does this work? The webclient node does not have a rigidly linked reference to the assembly of the data model, so I am surprised that it does not report βtype not foundβ or some such error. Is this a safe way to work or do I need to add additional links to my project (i.e. from a class library to a data model)?
source share