Created
January 28, 2020 12:11
-
-
Save tonnguyen/86daa4814d2b874ae860c6d79b25deb9 to your computer and use it in GitHub Desktop.
Generate TextOption items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var field = _fieldDefinitionService.Get(areaType, id).MakeWritableClone(); | |
var options = field.Option as TextOption; | |
var ran = new Random(); | |
options.Items = Enumerable.Repeat(0, 20000).Select(i => | |
new TextOption.Item() | |
{ | |
Name = new Dictionary<string, string> { { "*", ran.Next().ToString() } }, | |
Value = ran.Next().ToString() | |
}) | |
.ToList(); | |
field.Option = options; | |
_fieldDefinitionService.Update(field); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment