예제 #1
0
 public SanPhamModel CreateSanPham([FromBody] SanPhamModel model)
 {
     if (model.item_image != null)
     {
         var arrData = model.item_image.Split(';');
         if (arrData.Length == 3)
         {
             var savePath = $@"assets/images/{arrData[0]}";
             model.item_image = $"{savePath}";
             SaveFileFromBase64String(savePath, arrData[2]);
         }
     }
     model.item_id = Guid.NewGuid().ToString();
     _itemBusiness.Create(model);
     return(model);
 }
예제 #2
0
        public SanPhamModel create(SanPhamModel spmoi)
        {
            var newpro = isp.Create(spmoi);

            return(newpro);
        }