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)); }
public static Notification_Order ToNotification_Order(this Notification_OrderModel entity) { return(entity.MapTo <Notification_OrderModel, Notification_Order>()); }