示例#1
0
        public static dataModel.AddressEntity ToDataModel(this coreModel.Address address)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            var retVal = new dataModel.AddressEntity();

            retVal.InjectFrom(address);

            retVal.AddressType = address.AddressType.ToString();
            return(retVal);
        }
示例#2
0
        public static coreModel.Address ToCoreModel(this dataModel.AddressEntity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            var retVal = new coreModel.Address();

            retVal.InjectFrom(entity);
            retVal.AddressType = (coreModel.AddressType)Enum.Parse(typeof(coreModel.AddressType), entity.AddressType);

            return(retVal);
        }