public async Task <BaseResult> CreateOrUpdate(Notification_OrderModel model, int updateBy = 0, string updateByUserName = "")
        {
            var order = model.ToNotification_Order();

            order.CreatedTime = DateTime.Now;
            if (order.Id > 0)
            {
                //Cập nhật
                return(await Update(order));
            }
            else
            {
                //Thêm mới
                return(await Create(order));
            }
        }
        public async Task <IActionResult> CreateOrUpdate([FromBody] Notification_OrderModel order)
        {
            var result = await notification_OrderService.CreateOrUpdate(order);

            return(Ok(result));
        }
Exemplo n.º 3
0
 public static Notification_Order ToNotification_Order(this Notification_OrderModel entity)
 {
     return(entity.MapTo <Notification_OrderModel, Notification_Order>());
 }