Skip to content
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

Merge to master for release #217

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ISOv4Plugin/Mappers/CropTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ public ISOCropType ExportCropType(Crop adaptCropType, ISOProductGroup cropTypePr
IEnumerable<CropVarietyProduct> cropVarieties = varietyProducts.Cast<CropVarietyProduct>().Where(v => v.CropId == adaptCropType.Id.ReferenceId);
if (cropVarieties.Any())
{
CropVarietyMapper varietyMapper = new CropVarietyMapper(TaskDataMapper);
isoCrop.CropVarieties = varietyMapper.ExportCropVarieties(cropVarieties).ToList();
isoCrop.CropVarieties = TaskDataMapper.CropVarietyMapper.ExportCropVarieties(cropVarieties).ToList();
}
}
}
Expand Down Expand Up @@ -112,8 +111,7 @@ public Crop ImportCropType(ISOCropType isoCropType)
//Varieties
if (isoCropType.CropVarieties.Any())
{
CropVarietyMapper varietyMapper = new CropVarietyMapper(TaskDataMapper);
varietyMapper.ImportCropVarieties(adaptCrop, isoCropType.CropVarieties);
TaskDataMapper.CropVarietyMapper.ImportCropVarieties(adaptCrop, isoCropType.CropVarieties);
}

return adaptCrop;
Expand Down
13 changes: 13 additions & 0 deletions ISOv4Plugin/Mappers/TaskDataMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ public ProductGroupMapper ProductGroupMapper
}
}

CropVarietyMapper _cropVarietyMapper;
public CropVarietyMapper CropVarietyMapper
{
get
{
if (_cropVarietyMapper == null)
{
_cropVarietyMapper = new CropVarietyMapper(this);
}
return _cropVarietyMapper;
}
}

GuidanceGroupMapper _guidanceGroupMapper;
public GuidanceGroupMapper GuidanceGroupMapper
{
Expand Down
Loading