Ejemplo n.º 1
0
        public async Task <IHttpActionResult> Create([FromBody] DealershipCreate dealershipCreate)
        {
            var dealershipEntity = new DealershipCreate().ToDealershipEntity(dealershipCreate);

            var entity = await Task.Run(() => dealershipApl.Create(dealershipCreate.Id,
                                                                   dealershipEntity));

            var summary =
                TypeAdapter.Adapt <DealershipEntity, DealershipCreate>(entity);

            return(this.Ok(summary));
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> CreateAsync([FromBody] DealershipCreate dealershipCreate,
                                                          [FromUri] int campaignId)
        {
            //var dealershipEntity = new DealershipCreate().ToDealershipEntity(dealershipCreate);
            var dealershipEntity =
                TypeAdapter.Adapt <DealershipCreate, DealershipEntity>(dealershipCreate);

            var registerSucceed = await Task.Run(() => dealershipApl.Register(campaignId,
                                                                              dealershipEntity));

            return(this.Ok(registerSucceed));
        }