[HttpPost]
public bool SaveGameInfo([System.Web.Http.FromBody]dynamic stat)
{
var newStat = JsonConvert.DeserializeObject(stat.StatisticsList);
return StatisticsModels.AddStatistics(newStat);
}
public void SaveStat() //сохранение статистики
{
try
{
var data = new List<Statistcs>();
string filePath = "stats.json";
data = Serializer.GetData(filePath);
data.Add(new Statistcs()
{
Date = DateTime.Now,
Result = state,
StepCounter = stepCounter,
UserFirst = true
});
Serializer.SetData(filePath, data);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}