Пример #1
0
        public static SettingsMoleculeEntity FromDomainObjectToEntity(SettingsMolecule source)
        {
            SettingsMoleculeEntity target = new SettingsMoleculeEntity();

            target.Id = source.Id;
            target.OverrideAcceptable = source.OverrideAcceptable;
            target.OverrideOptimal    = source.OverrideOptimal;
            target.SettingsAtom.Add(SettingsAtomAssembler.FromDomainObjectToEntity(source.PredefinedAtom));
            target.SettingsAtom.Add(SettingsAtomAssembler.FromDomainObjectToEntity(source.StatisticalAtom));
            target.AnalyticRuleSettingsEntityId = source.AnalyticRuleSettingsId;
            return(target);
        }
Пример #2
0
        public static SettingsMoleculeDto FromEntityToDto(SettingsMoleculeEntity source)
        {
            SettingsMoleculeDto target = new SettingsMoleculeDto();

            target.Id = source.Id;
            target.OverrideAcceptable     = source.OverrideAcceptable;
            target.OverrideOptimal        = source.OverrideOptimal;
            target.PredefinedAtom         = SettingsAtomAssembler.FromEntityToDto(source.SettingsAtom.First(a => a.Type == (int)SettingsAtomType.Predefined));
            target.StatisticalAtom        = SettingsAtomAssembler.FromEntityToDto(source.SettingsAtom.First(a => a.Type == (int)SettingsAtomType.Statistical));
            target.AnalyticRuleSettingsId = source.AnalyticRuleSettingsEntityId;
            return(target);
        }
Пример #3
0
 public static void CopyEntityProperties(
     SettingsMoleculeEntity source, SettingsMoleculeEntity target)
 {
     target.Id = source.Id;
     target.AnalyticRuleSettingsEntityId =
         source.AnalyticRuleSettingsEntityId;
     target.OverrideAcceptable = source.OverrideAcceptable;
     target.OverrideOptimal    = source.OverrideOptimal;
     foreach (SettingsAtomEntity atom in source.SettingsAtom)
     {
         SettingsAtomAssembler.CopyEntityProperties(atom,
                                                    target.SettingsAtom.First(a => a.Type == atom.Type));
     }
 }