Answer the question
In order to leave comments, you need to log in
Organization of classes in C#, passing different types of classes to the parameter
Good afternoon!
Not very familiar with C #, I'm trying to solve a problem (if at all possible), there is a class A that performs certain operations, 2 parameters are passed to its constructor, an instance of the class and a database (it does not affect my problem). Briefly its structure:
class A {
protected B context;
public A(B context, C BD){
context = context;
}
}
Answer the question
In order to leave comments, you need to log in
If I correctly understood the task, then you can inherit D from B, and overload the necessary methods.
the context parameter (type B) is generated by the system and is read-only, and the turning point was to artificially slip your context (type D) with the necessary methods and data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question