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); }
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); }