Right way to get an instance of DataTypeService 7.5.8
Hi All,
We have just upgraded to 7.5.8 and are using the datatypeservice as part of a migration.
I was wondering what the right way to grab an instance of it was whereas previously it looked like:
var dts = new DataTypeService();
var dropdownValueToSet = dts.GetPreValuesCollectionByDataTypeId(templateVariantsDropdownDatatypeId).PreValuesAsDictionary
.First(d => d.Value.Value == templateVariantName).Value.Id;
The method sig has changed and I'm not sure how to initialise the dependencies for the UOW, repository factory etc.
Right way to get an instance of DataTypeService 7.5.8
Hi All, We have just upgraded to 7.5.8 and are using the datatypeservice as part of a migration.
I was wondering what the right way to grab an instance of it was whereas previously it looked like:
var dts = new DataTypeService(); var dropdownValueToSet = dts.GetPreValuesCollectionByDataTypeId(templateVariantsDropdownDatatypeId).PreValuesAsDictionary .First(d => d.Value.Value == templateVariantName).Value.Id;
The method sig has changed and I'm not sure how to initialise the dependencies for the UOW, repository factory etc.
Thanks :)
Hi Tom
The best way is to use standalone context of Umbraco like:
You don't need to create a new instance of Services I think.
Just use what we have in context.
Thanks
Alex
Hi Tom
Did you find solution?
Is it working for you?
Thanks,
Alex
Hi Alex, Yes that worked perfectly thanks very much :)
is working on a reply...