>>337
ドメインモデルとデータが違うのはその通り。

悪かった。真面目にコードを書く。

class Box {
public int Height { get; set; }
public int Width { get; set; }
}
これがドメインモデル貧血症

class Box {
public int Height { get; }
public int Width { get; }
public Box(int height, int width) {
if (height <= 0) {
throw new ArgumentOutOfRangeException(nameof(height));
}
if (width <= 0) {
throw new ArgumentOutOfRangeException(nameof(width));
}
Height = height;
Width = width;
} public int Area() {
return Height * Width;
}
}
これがオブジェクト指向

スマホのお陰で改行が狂ってるかもだが。