C# automate constructors refactoring -


i got ask if there option in c#, lets got suche code :

class {    public a(int b); }  class b : {    public b(int b)    : base(b); }  class c : b {     public c(int b)     : base(b) } 

and if want change in class "int b" "car b" need change in every single class, possible refactor somehow automate?

if possible, can use c# generics :

class a<t> {     public a(t b)     {} }  class b<t> : a<t> {    public b(t b)    : base(b)     {} }  class c<t> : b<t> {     public c(t b)     : base(b)     { }  } 

you can use following syntax int (and use same principle car) :

var intvar = new c<int>(10); 

otherwise, there no tool change types @ once. if change parameter type car, resharper propose refactor constructor of derived class.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -