public ProvincesViewModel(IAddressDataAccess addressDataAccess) { _addressDataAccess = addressDataAccess; ModelDeleter(i => _addressDataAccess.DeleteProvince(i)); ModelSaver(p => _addressDataAccess.SaveProvince(p)); ModelsLoader(() => _addressDataAccess.GetProvinces()); }
public AddressesViewModel(IAddressDataAccess addressDataAccess) { ProvincesViewModel = new ProvincesViewModel(addressDataAccess); DistrictsViewModel = new DistrictsViewModel(addressDataAccess); WardsViewModel = new WardsViewModel(addressDataAccess); BindProperties(); }
public WardsViewModel(IAddressDataAccess addressDataAccess) { _addressDataAccess = addressDataAccess; ModelDeleter(i => _addressDataAccess.DeleteWard(i)); ModelSaver(w => { if (SelectedDistrict?.Id == null) { return(null); } w.DistrictId = SelectedDistrict.Id.Value; return(_addressDataAccess.SaveWard(w)); }); ModelsLoader( () => SelectedDistrict?.Id == null ? new Ward[0] : _addressDataAccess.GetWards(SelectedDistrict.Id.Value)); }
public DistrictsViewModel(IAddressDataAccess addressDataAccess) { _addressDataAccess = addressDataAccess; ModelDeleter(i => _addressDataAccess.DeleteDistrict(i)); ModelSaver(d => { if (SelectedProvince?.Id == null) { return(null); } d.ProvinceId = SelectedProvince.Id.Value; return(_addressDataAccess.SaveDistrict(d)); }); ModelsLoader(() => SelectedProvince?.Id == null ? new District[0] : _addressDataAccess.GetDistricts(SelectedProvince.Id.Value)); }
public AddressService(IAddressDataAccess addressDataAccess) { AddressDataAccess = addressDataAccess; }
public AddressBusinessModel(IAddressDataAccess dataAccess) { this.DataAccess = dataAccess; }
internal AtlasDeliveryService(IMicroserviceProxy microserviceProxy, IAddressDataAccess addressDataAccess) { _microserviceProxy = microserviceProxy; _addressDataAccess = addressDataAccess; }
public AddressService(IAddressDataAccess addressDataAccess) { this.addressDataAccess = addressDataAccess; }