Exemplo n.º 1
0
        public async Task DeleteAsync(long id)
        {
            var company = await GetByIdAsync(id);

            ExceptionFuncs.IsNull(company, "Company does not exist.", HttpStatusCode.UnprocessableEntity);

            await RemoveAsync(company);

            await SaveChangesAsync();
        }
Exemplo n.º 2
0
        public async Task UpdateAsync(long id, NewCompanyRequest model)
        {
            var company = await GetByIdAsync(id);

            ExceptionFuncs.IsNull(company, "Company does not exist.", HttpStatusCode.UnprocessableEntity);

            UpdateCompanyModel(company, model);

            await UpdateAsync(company);

            await SaveChangesAsync();
        }