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); }
public SanPhamModel create(SanPhamModel spmoi) { var newpro = isp.Create(spmoi); return(newpro); }