public DailyWorkRecord Post([FromBody] DailyWorkRecord DailyWorkRecord) { if (ModelState.IsValid && DailyWorkRecord.DailyWork.ModuleId == _entityId) { DailyWorkRecord = _DailyWorkRecords.AddDailyWorkRecord(DailyWorkRecord); _logger.Log(LogLevel.Information, this, LogFunction.Create, "DailyWorkRecord Added {DailyWorkRecord}", DailyWorkRecord); } return(DailyWorkRecord); }
public void ImportModule(Module module, string content, string version) { List <DailyWorkRecord> DailyWorkRecords = null; if (!string.IsNullOrEmpty(content)) { DailyWorkRecords = JsonSerializer.Deserialize <List <DailyWorkRecord> >(content); } if (DailyWorkRecords != null) { foreach (DailyWorkRecord DailyWorkRecord in DailyWorkRecords) { DailyWorkRecord _DailyWorkRecord = new DailyWorkRecord(); _DailyWorkRecord.DailyWork.ModuleId = module.ModuleId; _DailyWorkRecords.AddDailyWorkRecord(_DailyWorkRecord); } } }