Have mostly worked in Java when using statically typed langs, so not really C# guru, but from reading gut reaction would be to check out if having a default implementation of an interface
https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html might help against embolded OP, for instance:
http://stackoverflow.com/questions/20416919/c-sharp-using-extension-methods-to-provide-default-interface-implementationhttp://stackoverflow.com/questions/3271223/how-to-define-the-default-implementation-of-an-interface-in-cif access to the salespoint and operator properties in those classes is not restricted, you could call a method with (object [,propertynameoverride]) method signature
HTH
thomas
>Hi everybody,
>
>I am having a dilemma of the best implementation and wondering if you can make suggestions.
>
>In our database several tables have salespoint and operator columns (or similar named columns). These columns need to be populated with the currently logged operator and salespoint when a row is added or updated.
>
>For each of the table a model class is generated using Reverse POCO generator.
>
>For manipulations with the model class we use repository classes which are based on the RepositoryBase class which uses generics.
>
>Then we use adapter class (which is not based on anything) and then the API Controller class that also uses ViewModel (and not directly the model).
>
>So, I'd like to introduce a method that can update the operator and salespoint columns using OperatorSession static class.
>
>Currently I'm doing it in the API Controller class in each case when it's required
(e.g. duplicating code).
>
>I am wondering what would be a best way to introduce such a generic method based on what I described.
>
>Thanks in advance for the suggestions.