Exemplo n.º 1
0
        public Deal AddDeal(DealSummary dealSummary)
        {
            var savingDeal = new Deal()
            {
                CustomerID = dealSummary.CustomerID,
                VehicleId  = dealSummary.VehicleId,
                UserId     = dealSummary.UserId
            };

            return(dealRepository.AddDeal(savingDeal));
        }
Exemplo n.º 2
0
 public IHttpActionResult CreateDeal([FromBody] DealSummary dealSummary)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (!userSerivce.DoesUserExists(dealSummary.UserId))
     {
         return(BadRequest($"Store with id {dealSummary.UserId} does not exists"));
     }
     return(Ok(dealService.AddDeal(dealSummary)));
 }