class - How to compare two classes in vb.net? -


let's suppose have class this:

class myclass(of template)     'some things here end class 

so far, good. however, things depending on template, like

class myclass(of template)     'some things here     public sub mymethod         'if template myotherclass         '    things         'else         '    other things         'end if     end sub end class 

of course, give object , check whether typeof (obj) myotherclass, seems less intuitive me. there way compare 2 classes in vb.net?

you compare type

class myclass(of template)     'some things here      public sub mymethod         if gettype(template) gettype(myotherclass)             things         else             other things         end if     end sub  end class 

but seems bad thing do. point of oo have logic in it's respective class instead of doing this.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -