private Problem ToStorageEntity(ProblemData data) { var problem = new Problem { Description = data.Description, LastModifiedTime = DateTime.UtcNow, Name = data.Name, GeneratorType = data.GeneratorType }; problem.Type = _problemTypeRepository.Get(x => x.Type.ToString() == data.Type.ToString()); problem.SpecificData = JsonConvert.SerializeObject(data.GetAdditionalData()); return(problem); }
public void Create(ProblemData data) { var problem = ToStorageEntity(data); _problemRepository.Create(problem); }