// PUT: api/Company/5 public void Put(int id, [FromBody] RentalDataModel value) { var service = new RentalService(); var result = new StrictRentalDataModel() { cena_miesieczna = value.cena_miesieczna, data_rozpoczecia = value.data_rozpoczecia, data_zakonczenia = value.data_zakonczenia, id_mieszkania = value.id_mieszkania, id_najemcy = value.id_najemcy, id_wynajmu = value.id_wynajmu }; service.AddOrEditRental(result); }
public RentalDataModel GetSingleRentalDataModel(int rentalId) { var rental = new RentalDataModel(); try { using (var ctx = new DBProjectEntities()) { var queryResult = ctx.RentalDataView.FirstOrDefault(x => x.id_wynajmu == rentalId); rental = ModelMapper.Mapper.Map <RentalDataModel>(queryResult); } } catch (Exception ex) { Console.WriteLine(ex.Message); } return(rental); }
// POST: api/Company public void Post([FromBody] RentalDataModel value) { return; }