public async Task UpdateKundeTest() { var kunde = await _target.GetById(1); kunde.Vorname = "Wilma"; await _target.Update(kunde); var result = await _target.GetById(1); Assert.Equal("Wilma", result.Vorname); }
public override async Task <KundeDto> GetById(GetKundeByIdRequest request, ServerCallContext context) { KundeManager manager = new KundeManager(); Kunde kunde = await manager.GetById(request.Id); KundeDto result = kunde.ConvertToDto(); return(result); }
public KundeDto GetKundeById(int id) { try { return(KundeManager.GetById(id).ConvertToDto()); } catch (InvalidOperationException) { var fault = new GenericFault("Keine Gültige ID"); throw new FaultException <GenericFault>(fault); } }
public KundeDto ReadKunde(int id) { WriteActualMethod(); var customer = _kundeManager.GetById(id); if (customer == null) { throw new FaultException <AutoReservationFault>(new AutoReservationFault { ErrorCode = AutoReservationFault.RequestedEntityDoesNotExist }); } return(customer.ConvertToDto()); }
public KundeDto GetKundeById(int kundeId) { WriteActualMethod(); return(kundeManager.GetById(kundeId).ConvertToDto()); }