public static Mandate FromDomain(Domain.Farm.Farm farm, Domain.Mandate.Mandate mandate)
 {
     return(new Mandate
     {
         Farm = ApplicationServices.ViewModel.Farm.Farm.FromDomain(farm),
         Inspections = mandate.Inspections.Select(Inspection.FromDomain).ToArray()
     });
 }
Esempio n. 2
0
 public SerializationTests(ITestOutputHelper testOutputHelper)
 {
     testOutputHelper_ = testOutputHelper;
     Console.SetOut(new TestOutputWriter(testOutputHelper_));
     checklist_  = TestDataHelper.ConstructChecklist();
     inspection_ = TestDataHelper.ConstructInspection();
     farm_       = TestDataHelper.ConstructFarm();
 }
Esempio n. 3
0
        public static Farm FromDomain(Domain.Farm.Farm farm)
        {
            var model = new Farm
            {
                Id                          = (int)farm.Id,
                Ktidb                       = farm.Ktidb,
                FarmName                    = farm.FarmName,
                Address                     = farm.Address,
                FarmType                    = farm.FarmType,
                FarmTypeCode                = farm.FarmTypeCode,
                Email                       = farm.Email,
                PhoneNumber                 = farm.PhoneNumber,
                AgriculturalArea            = farm.AgriculturalArea,
                NonAgriculturalArea         = farm.NonAgriculturalArea,
                BovineStandardUnits         = farm.BovineStandardUnits,
                BovineStandardUnitsFromBdta = farm.BovineStandardUnitsFromBdta,
                Badges                      = farm.Badges?.Select(Badge.Badge.FromDomain).ToArray()
            };

            return(model);
        }