public async Task <BaseResult> CreateOrUpdate(Notification_ImageModel model, int updateBy = 0, string updateByUserName = "") { var order = model.ToNotification_Image(); 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_ImageModel order) { var result = await notification_OrderService.CreateOrUpdate(order); return(Ok(result)); }
public static Notification_Image ToNotification_Image(this Notification_ImageModel entity) { return(entity.MapTo <Notification_ImageModel, Notification_Image>()); }