示例#1
0
        public async Task <mdlfareruleApi> FareRule([FromServices] IBooking booking, mdlFareRuleRequest mdl)
        {
            mdlfareruleApi mdlfarerule = new mdlfareruleApi();

            if (ModelState.IsValid)
            {
                try
                {
                    booking.CustomerId  = _customerId;
                    booking.UserId      = _userId;
                    mdlfarerule.mdlFare = await booking.FareRule(mdl);

                    mdlfarerule.StatusCode    = 1;
                    mdlfarerule.StatusMessage = "Success";
                }
                catch (Exception ex)
                {
                    mdlfarerule.StatusCode    = 0;
                    mdlfarerule.StatusMessage = ex.Message;
                }
            }
            return(mdlfarerule);
        }