.tree
❔ Access a DB property from a not mapped property
Just realized I totally messed up the question.
Class A has this property
[ForeignKey("ArticleID")]
public ArticleModel Foo {
get => Get(ref article);
set => Set(value, ref article);
}
private ArticleModel article = null;
Which references this property in class B:
[ForeignKey("KindID")]
public KindModel Bar {
get => Get(ref kind);
set => Set(value, ref kind);
}
private KindModel kind = null;
Now in class A I want another property of type KindModel
that stores the value of Bar, which is the same type.19 replies
❔ Issues in Repository pattern with defining Common Code
Yeah makes sense. So the DoAddNumbers in my inheriting class has to be protected now since the abstract method in my abstract class is protected too. So it looks like this now:
Now when I call it like this:
It uses the public AddNumbers from my abstract, does the common code, then it calls DoAddNumbers which is abstract, so it uses the specific implementation it has itself?
31 replies
❔ Issues in Repository pattern with defining Common Code
So in my example
The inheriting class would be
Where would I call DoAddNumbers now? My ArcObjects specific implementation of AddNumbers still needs to be there, but how do I tell it to do common code and then the specifig AddNumbers?
31 replies
❔ Issues in Repository pattern with defining Common Code
No, my issue was this: If I have an abstract method in my abstract class AddNumbers, there is some code that I want each of my inheriting classes to do when they execute AddNumbers. Since it's abstract I cant put that code into the method itself, so I tried to define the common code in its own method and write a wrapper like "AddnumbersWrapper" that calls the common code method and the abstract method
31 replies
❔ Issues in Repository pattern with defining Common Code
Sorry, this should be the correct code: https://paste.mod.gg/jiooicbvytsm/0
31 replies