コード例 #1
0
        public Task <int> DeleteModel(int id)
        {
            var model = _dbContext.AccountingCategories.FirstOrDefault(entity => entity.Id == id);

            MoonlayEntityExtension.FlagForDelete(model, _identityService.Username, UserAgent);
            _dbContext.AccountingCategories.Update(model);
            return(_dbContext.SaveChangesAsync());
        }
コード例 #2
0
        public async Task <int> DeleteModel(int id)
        {
            var model = _dbContext.AccountingUnits.FirstOrDefault(entity => entity.Id == id);

            MoonlayEntityExtension.FlagForDelete(model, _identityService.Username, UserAgent);
            _dbContext.AccountingUnits.Update(model);
            var result = await _dbContext.SaveChangesAsync();

            SetCache();
            return(result);
        }