E
E
embiid2021-02-22 18:01:13
ASP.NET
embiid, 2021-02-22 18:01:13

Is it possible to store calculation logic in Model?

For example, there is some kind of geometric figure described in the model.
Let it be a triangle.
He has 3 lines.
Is it correct to create a getter that calculates the perimeter?

Or is it better to still calculate the perimeter and area in the controller?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Vasilyev, 2021-02-22
@embiid

You can make some small parameters in getters. And so the business logic should be at least in services.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question