Exemple #1
0
        public static async Task <ReturnedSaveFuncInfo> SaveAsync(ProductBussines cls)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                using (var client = new HttpClient())
                {
                    var json    = Json.ToStringJson(cls);
                    var content = new StringContent(json, Encoding.UTF8, "application/json");
                    var result  = await client.PostAsync(Utilities.WebApi + "/api/Product/SaveAsync", content);
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
Exemple #2
0
 public static ReturnedSaveFuncInfo Save(ProductBussines cls) => AsyncContext.Run(() => SaveAsync(cls));