2
Answers

Constructors or Methods

Olaf Never

Olaf Never

13y
1.5k
1
Hi there

I've got a question about C#. I've seen a lot of projects with the two examples:

  • The first one get an existing Order with Order o = new Order(1);
  • The other get an existing Order with Order o = OrderManager.GetOrderById(1);


The first used an constructor the other an method by an other class. Is that the "programming-style" of a programmer or a C# rule?

I hope you understand what I tried to ask...

Regards,

Olaf

Answers (2)