상속: IWriter
예제 #1
0
 private Crop Map(CTP isoCropType)
 {
     var crop = new Crop();
     crop.Id.UniqueIds.Add(new UniqueId
     {
         Id = Guid.NewGuid().ToString(),
         CiTypeEnum = CompoundIdentifierTypeEnum.UUID,
         Source = "http://www.deere.com",
         SourceType = IdSourceTypeEnum.URI
     });
     return crop;
 }
예제 #2
0
        private CTP Map(Crop crop, Dictionary<int, string> keyToIsoId, int cropIndex, Catalog setupCatalog)
        {
            var ctp = new CTP
                {
                    B = crop.Name
                };
            ctp.A = ctp.GetIsoId(cropIndex);

            var cvts = setupCatalog.Products.Where(x => x is CropVariety).Cast<CropVariety>().Where(v => v.CropId == crop.Id.ReferenceId).Select(Map);

            var cvtArray = cvts as CVT[] ?? cvts.ToArray();
            if (cvtArray.Any())
            {
                ctp.Items = cvtArray.ToArray();
            }

            keyToIsoId.Add(crop.Id.ReferenceId, ctp.A);
            return ctp;
        }