public Product ProductFromHash(string hash) { var json = StringCompression.Decompress(hash); var product = JsonConvert.DeserializeObject <Product>(json); return(product); }
public string CreateHash(string productName, string ingredients) { var product = new Product(productName, ingredients); var json = JsonConvert.SerializeObject(product); var hash = StringCompression.Compress(json); return(hash); }