示例#1
0
        public static T Insert <T>(T obj) where T : SObject
        {
            var jsonData = JsonFactory.GetJson(obj);

            var         objectName  = typeof(T).Name;
            HttpManager httpManager = new HttpManager();

            jsonData = httpManager.Post($"sobjects/{objectName}/", jsonData);
            RecordCreateResponse recordCreateResponse = JsonConvert.DeserializeObject <RecordCreateResponse>(jsonData);

            obj.Id = recordCreateResponse.id;

            UnitTestDataManager.AddId(obj.Id.ToString());

            return(obj);
        }