예제 #1
0
        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));
            }
        }
예제 #2
0
        public async Task <IActionResult> CreateOrUpdate([FromBody] Notification_ImageModel order)
        {
            var result = await notification_OrderService.CreateOrUpdate(order);

            return(Ok(result));
        }
예제 #3
0
 public static Notification_Image ToNotification_Image(this Notification_ImageModel entity)
 {
     return(entity.MapTo <Notification_ImageModel, Notification_Image>());
 }