//--------------// //[HttpPost] public string lesson5() { string AltitudeStr = Request.Query.FirstOrDefault(p => p.Key == "altitude").Value; int Altitude = Int32.Parse(AltitudeStr); string HeightStr = Request.Query.FirstOrDefault(p => p.Key == "height").Value; int Height = Int32.Parse(HeightStr); int Square = Altitude * Height / 2; Geometry geo = new Geometry(Altitude, Height); return $"S triangle with a {geo.Altitude} and h {geo.Height} = {geo.GetSquare()}"; }
public string Sum(Geometry[] geos) { return $"S squares = {geos.Sum(g=>g.GetSquare())}"; }