示例#1
0
        public void Add(IPFamiliesModel iPFamiliesModel)
        {
            if (iPFamiliesModel == null)
            {
                //throw new ArgumentNullException(nameof(iPFamiliesModel));
            }

            ip_families ipFamiliesDB = Mapper.Map(iPFamiliesModel, new ip_families());

            AMDSystemsEntities.ip_families.Add(ipFamiliesDB);
            AMDSystemsEntities.SaveChanges();
        }
示例#2
0
文件: Mapper.cs 项目: SJ-E/AMDSystems
        public static IPFamiliesModel Convert(ip_families ipFamiliesDB)
        {
            if (ipFamiliesDB == null)
            {
                //throw new ArgumentNullException(nameof(ipFamiliesDB));
            }

            return(new IPFamiliesModel()
            {
                family_id = ipFamiliesDB.family_id,
                family_name = ipFamiliesDB.family_name
            });
        }
示例#3
0
文件: Mapper.cs 项目: SJ-E/AMDSystems
        public static ip_families Map(IPFamiliesModel iPFamiliesModel, ip_families ipFamiliesDB)
        {
            if (iPFamiliesModel == null)
            {
                //throw new ArgumentNullException(nameof(iPFamiliesModel));
            }

            if (ipFamiliesDB == null)
            {
                //throw new ArgumentNullException(nameof(ipFamiliesDB));
            }

            ipFamiliesDB.family_name = iPFamiliesModel.family_name;

            return(ipFamiliesDB);
        }