0

I need to call method having a specific attribute passed some string data. For the setup below, how can you call(invoke) method having attribute parameter of "Call this method" without using reflection ? By the way I use ninject as IoC.

public interface ISomeInterface
{
    int Method1();
    int Method2();
}

public class SomeClass: ISomeInterface
{
    [SomeAttribute("Do not call this method")]
    public int Method1(){
       return 1;
    };

    [SomeAttribute("Call this method")]
    public int Method2(){
       return 2;
    };
}   
serefbilge
  • 1,654
  • 4
  • 29
  • 55
  • i don't think this question has *anything* to do with dependency injection, or why should it? – BatteryBackupUnit Jun 18 '15 at 17:49
  • 1
    You can't access Attributes without using reflection so it's likely that this is impossible. Your options would be do either use reflection or solve your problem without using attributes. – shf301 Jun 19 '15 at 05:44

0 Answers0