public object Delete(Guid global_setting_id) { return(base.ExecuteFunction("Delete", delegate() { dm.GlobalSetting delete = this.API.Direct.GlobalSettings.GetById(global_setting_id); this.API.Direct.GlobalSettings.Delete(global_setting_id); return Http200(new ActionResult() { success = true, message = global_setting_id.ToString() }); })); }
public object GetById(Guid global_setting_id) { return(base.ExecuteFunction <object>("GetById", delegate() { dm.GlobalSetting result = this.API.Direct.GlobalSettings.GetById(global_setting_id); if (result == null) { return Http404("GlobalSetting"); } return base.Http200(new ItemResult <sdk.GlobalSetting>() { success = true, item = result.ToSDKModel() }); })); }
public object Update(Guid global_setting_id, sdk.GlobalSetting globalsetting) { return(base.ExecuteFunction <object>("Update", delegate() { this.ValidateNotNull(globalsetting, "GlobalSetting"); this.ValidateRouteMatch(global_setting_id, globalsetting.global_setting_id, "GlobalSetting"); globalsetting.global_setting_id = global_setting_id; dm.GlobalSetting update = globalsetting.ToDomainModel(); update = this.API.Direct.GlobalSettings.Update(update); sdk.GlobalSetting existing = this.API.Direct.GlobalSettings.GetById(update.global_setting_id).ToSDKModel(); return base.Http200(new ItemResult <sdk.GlobalSetting>() { success = true, item = existing }); })); }
public object Create(sdk.GlobalSetting globalsetting) { return(base.ExecuteFunction <object>("Create", delegate() { this.ValidateNotNull(globalsetting, "GlobalSetting"); dm.GlobalSetting insert = globalsetting.ToDomainModel(); insert = this.API.Direct.GlobalSettings.Insert(insert); sdk.GlobalSetting result = insert.ToSDKModel(); return base.Http201(new ItemResult <sdk.GlobalSetting>() { success = true, item = result } , string.Format("api/globalsetting/{0}", globalsetting.global_setting_id)); })); }