public async Task <IActionResult> Post(AggrModel model) { try { var newModel = await _context.AddAsync(model); var ret = await _context.SaveChangesAsync(); } catch (Exception ex) { _logger.LogError(ex, "Post DSS Model failed"); return(BadRequest("Post DSS Model failed")); } return(Ok(model)); }
/// <summary> /// Get Config from deserializing model config in Json format /// </summary> /// <param name="model"></param> /// <returns></returns> public static AggrConfig GetConfig(this AggrModel model) { var dssConfig = JsonConvert.DeserializeObject <AggrConfig>(model.Config); return(dssConfig); }