0

I have a class like :

 public class OverTimeViewModel
    {
        public Guid uniqeid { get; set; }
        public string WorkType { get; set; }
        public int RequestDate { get; set; }
        public string RequestTime { get; set; }

    }

I want add Method like:

  public string Write(string message)
                    {

                            return message;
                    } 

is there any way to this by roslyn or codedom?

Sina Razavi
  • 45
  • 3
  • 9
  • 1
    Possible duplicate of [Is it possible to add a method to an EXISTING class at runtime? why or why not?](https://stackoverflow.com/questions/11162094/is-it-possible-to-add-a-method-to-an-existing-class-at-runtime-why-or-why-not) – Blue Dec 13 '17 at 15:41
  • 2
    What are you trying to solve? Maybe there is another way of doing it... – Bruno Belmondo Dec 13 '17 at 15:48

0 Answers0