public static string GetDtoName(string serializedDto) { try { FiniteDto dto = JsonConvert.DeserializeObject <FiniteDto>(serializedDto); return(dto.DtoName); } catch { // TODO: maybe track why we got an empty named or invalid dto here. } return(null); }
public static string SerializeDto(FiniteDto dto) { string serialized = JsonConvert.SerializeObject(dto, Formatting.None, GetJsonSerializerSettings()); return(serialized); }