-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aligning with changes in BHoMAdapter Refactoring Level 04 #11
Conversation
// If unset, set the pushType to AdapterSettings' value (base AdapterSettings default is FullCRUD). | ||
if (pushType == PushType.AdapterDefault) | ||
pushType = m_AdapterSettings.DefaultPushType; | ||
|
||
IEnumerable<IBHoMObject> objectsToPush = ProcessObjectsForPush(objects, actionConfig); // Note: default Push only supports IBHoMObjects. | ||
|
||
bool success = true; | ||
|
||
CreateModel(objectsToPush.ToList()); | ||
|
||
return success ? objects.ToList() : new List<object>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you want is to simply have the Push call Create
, which is the only CRUD method implemented.
This can be achieved by setting the m_AdapterSetting
private field in your constructor. Please add this in the Adapter constructor:
m_AdapterSettings.DefaultPushType = oM.Adapter.PushType.CreateOnly;
This way the Adapter will simply call ICreate
method.
If in the future you will write the IRead
or any other CRUD method, you can switch this to oM.Adapter.PushType.FullCRUD
or anything you need.
Additionally, as I see there's no DependencyTypes
in the Adapter, please also add below the previous:
m_AdapterSettings.HandleDependencies = false;
Then please delete the Push override completely, and test if all is good.
Approved on the basis of the new changes I put in. Please test this thoroughly and leave a request for changes in case this does not work under the script tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
NOTE: Depends on
BHoM/BHoM_Engine#1371
BHoM/BHoM_Adapter#164
BHoM/BHoM_UI#167
If you use Grasshopper: Aligning with changes in BHoMAdapter Refactoring Level 04 Grasshopper_UI#440
If you use Excel: https://github.com/BHoM/Excel_Toolkit/pull/172
If you use Dynamo: Aligning with changes in BHoMAdapter Refactoring Level 04 Dynamo_UI#188
If your Toolkit needs Socket_Toolkit: Aligning with changes in BHoMAdapter Refactoring Level 04 Socket_Toolkit#57
If your Toolkit needs Mongo_Toolkit: Aligning with changes in BHoMAdapter Refactoring Level 04 Mongo_Toolkit#82
If you want the Adapter components to be automatically upgraded to their new version in your test scripts: Adding support for method upgrade Versioning_Toolkit#8
Issues addressed by this PR
Fixes #3
Test files