public object Delete(Guid account_id) { return(base.ExecuteFunction("Delete", delegate() { dm.Account delete = this.API.Direct.Accounts.GetById(account_id); this.API.Direct.Accounts.Delete(account_id); return Http200(new ActionResult() { success = true, message = account_id.ToString() }); })); }
public object Create(sdk.Account account) { return(base.ExecuteFunction <object>("Create", delegate() { this.ValidateNotNull(account, "Account"); dm.Account insert = account.ToDomainModel(); insert = this.API.Direct.Accounts.Insert(insert); sdk.Account result = this.API.Index.Accounts.GetById(insert.account_id); return base.Http201(new ItemResult <sdk.Account>() { success = true, item = result } , string.Format("api/account/{0}", account.account_id)); })); }
public object Update(Guid account_id, sdk.Account account) { return(base.ExecuteFunction <object>("Update", delegate() { this.ValidateNotNull(account, "Account"); this.ValidateRouteMatch(account_id, account.account_id, "Account"); account.account_id = account_id; dm.Account update = account.ToDomainModel(); update = this.API.Direct.Accounts.Update(update); sdk.Account existing = this.API.Index.Accounts.GetById(update.account_id); return base.Http200(new ItemResult <sdk.Account>() { success = true, item = existing }); })); }