Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- using BPA.Helper;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.DosingSystem.Service
- {
- public class FromT<T>
- {
- public APIResult<T> Result { get; set; } = new APIResult<T>();
- public FromT(string msg)
- {
- if (string.IsNullOrEmpty(msg))
- return;
- //Result.Content = msg.ToJson("content").FromJSON<T>();
- if (msg.ToJson("content").TryFromJSON(out T temp))
- Result.Content = temp;
- else
- {
- Result.Content = (T)Convert.ChangeType(msg.ToJson("content"), typeof(T));
- }
- Result.ErrorMesg = msg.ToJson("message");
- Result.IsSuccess = msg.ToJson("isSuccess").ToLower().FromJSON<bool>();
- }
- }
-
-
- public class FromT
- {
- public APIResult Result { get; set; } = new APIResult();
- public FromT(string msg)
- {
- if (string.IsNullOrEmpty(msg))
- return;
- Result.ErrorMesg = msg.ToJson("message");
- Result.IsSuccess = msg.ToJson("isSuccess").ToLower().FromJSON<bool>();
- }
- }
- }
|