public string Add(Org org) { try { _orgApp.Add(org); } catch (Exception ex) { Result.Code = 500; Result.Message = ex.Message; } return(JsonHelper.Instance.Serialize(Result)); }
public string Add(OpenAuth.Repository.Domain.Org org) { try { _orgApp.Add(org); } catch (Exception ex) { Result.Code = 500; Result.Message = ex.InnerException?.Message ?? ex.Message; } return(JsonHelper.Instance.Serialize(Result)); }
public Response <Org> Add(Org obj) { var result = new Response <Org> (); try { _app.Add(obj); result.Result = obj; } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return(result); }
public void Add() { try { for (int i = 0; i < 2; i++) { var random = new Random(); int val = random.Next(); _app.Add(new Org { Id = string.Empty, Name = "test" + val, CreateTime = DateTime.Now, ParentId = null, ParentName = "", SortNo = 1 }); } } catch (Exception e) { Console.WriteLine(e.Message); } }