Esempio n. 1
0
        public async Task <IHttpActionResult> DeleteAccount(int id)
        {
            DbAnswerCode code = await this._accountRepository.Delete(id);

            if (code == DbAnswerCode.Ok)
            {
                return(Ok());
            }

            return(BadRequest());
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> UpdateAccount(AccountUpdateViewModel model)
        {
            AccountUpdate update = new AccountUpdate(this._accountRepository.Context);

            this._accountRepository.Updatable = update.CreateUpdate(model.UpdateType);
            DbAnswerCode code = await this._accountRepository.Update(model);

            if (code == DbAnswerCode.Ok)
            {
                return(Ok());
            }

            return(BadRequest());
        }