Esempio n. 1
0
        public AppliesToOffer Create(AppliesToOffer applies)
        {
            _repo.Add(applies);
            _repo.SaveChanges();

            return(applies);
        }
Esempio n. 2
0
 public AppliesToOfferDTO CreateBasicAppliesToOfferDTO(AppliesToOffer ap)
 {
     return(new AppliesToOfferDTO
     {
         AppliesToOfferId = ap.AppliesToOfferId,
         OfferId = ap.OfferId,
         Offer = ap.Offer,
         UserId = ap.UserId,
         User = ap.User
     });
 }
Esempio n. 3
0
        public IHttpActionResult Create(AppliesToOffer offer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var offerr = _service.Create(offer);

            return(Ok(offerr));
        }
Esempio n. 4
0
        public IHttpActionResult Update(AppliesToOffer offer, int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!_service.Update(offer))
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 5
0
 public bool Update(AppliesToOffer applies)
 {
     _repo.Update(applies);
     _repo.SaveChanges();
     return(true);
 }
Esempio n. 6
0
 public async Task <AppliesToOffer> AddApplieToOffer(AppliesToOffer apl)
 {
     return(await base.Post("", apl));
 }