that is really weird. I get the same error when setting the configuration in the way you describe.
I tried a couple of things and when I saved the DataType first (without the configuration) and set the configuration afterward (with the same values), the configuration is being set correctly. (below ugly/verbose code used for testing purposes)
var config = new BlockListConfiguration{...}
_dataTypeService.Save(newDataType);
var testType = _dataTypeService.GetDataType(name);
testType.Configuration = config;
_dataTypeService.Save(testType);
I hope someone else has some good insights on why it does not work when constructing it from scratch.
I'm trying to update a datatype configuration and wondered if you have this code to hand as it might give me the clues I need to solve a start node ID update problem I have?
Creating a Block List Data Type Programmatically
I am getting an error when trying to create a block list data type programmatically.
The issue is when I am trying to set the configuration.
Please can you help me work out where I am going wrong?
Here is my code:
Kind regards
Paul
Hi Paul,
that is really weird. I get the same error when setting the configuration in the way you describe.
I tried a couple of things and when I saved the DataType first (without the configuration) and set the configuration afterward (with the same values), the configuration is being set correctly. (below ugly/verbose code used for testing purposes)
I hope someone else has some good insights on why it does not work when constructing it from scratch.
Hi
I got it working. My friends Anders and Callum helped me in the MVP slack group.
I’ll update this post later with the solution.
Thanks
Paul
Hi Paul,
I'm trying to update a datatype configuration and wondered if you have this code to hand as it might give me the clues I need to solve a start node ID update problem I have?
Kind regards
Steve
Hi Steve
You should find the code you need in here:
https://github.com/prjseal/QuickBlocks/blob/e9621c4048c2b536ff12141fb12e5e589c072a6c/src/QuickBlocks/Services/BlockCreationService.cs#L421
Kind regards
Paul
Thanks, very useful.
Looks like my approach is fine. I'm struggling to update an existing data type rather than create a new one.
is working on a reply...