private void AddCropZones(FieldDto field) { for (int i = 0; i < DtoCount; i++) { var id = _cropZoneId++; var cropZone = new CropZoneDto { Id = id, Name = $"CropZone {id}", FieldUid = field.Uid, CropYear = DateTime.Now.Year - i % DtoCount }; CropZones.Add(cropZone); } }
private void AddFieldBoundaries(FieldDto field) { for (int i = 0; i < DtoCount; i++) { var id = _fieldBoundaryId++; var boundaryDto = new FieldBoundaryDto() { Id = id, FieldUid = field.Uid, CropYear = DateTime.Now.Year - i % DtoCount }; FieldBoundaries.Add(boundaryDto); } }
private void AddFields(FarmDto farm) { for (int i = 0; i < DtoCount; i++) { var field = new FieldDto { Uid = Guid.NewGuid(), Name = $"Field {i}", GrowerUid = farm.GrowerUid, FarmUid = farm.Uid }; AddCropZones(field); AddFieldBoundaries(field); Fields.Add(field); } }