Custom DataSources require changes when you upgrade past 2sxc 10.20, because we refactored some internal APIs for consistency. Here's what you need to do.
Why the API changed
While creating the docs.2sxc.org site we realised how much history had gotten into the code base. Many internal namespaces and object names were not consistent and we believe that once we publish them as official on the docs, people will use them more. So we wanted to make sure that whatever we do document and publish has a clean, consistend setup.
We were able to move the stuff around without breaking any razor templates and WebApis, but the DataSource API had some parts which had to be moved in a breaking way.
Important Changes for Custom DataSources
Here the important bits
- If your DataSource has a VisualQuery Attribute, you probably need to change this
- Switch from
This switch is optional, because we left an obsolete version of the old Attribute in the code base.
- In the attribute you need to switch the Type (which is a DataSourceType.XXX) to the new DataSourceType which is now also in ToSic.Eav.DataSources.Queries.
- If you are using PropertyAccess objects, they were all moved into a new namespace:
and th core objects were also renamed to be LookUpInXXX
- You probably have a GetList or similar which returns items of
this must be changed to
because we decided that we would rather organize interfaces by topic then by the fact that they are interfaces.
- Your code probably inherits from
which should be changed to
because we dropped the 'DataSource' suffix which had been used inconsistently.
- For the same reason if you're using a DataTableDataSource internally, also rename that to DataTable.
- If you were referencing the DLL ToSic.Eav.Tokens this is not necessary any more, all the functionality was transferred to ToSic.Eav.Core which you already reference.
Of course you might also have used other internal Eav or Sxc objects which were never publicly documented. Most of them you'll find in the docs or in your IntelliSense. Please remember that anything not officially documented could still easily change in a future release.
We updated the sample code for the DnnFormAndList DataSource so you can check it out in the git repo.
With love from Switzerland,