Beispiel #1
0
        public async Task UpdateLanguageType(LanguageTypeDTO language)
        {
            var data = await a35MgeDbContext.LanguageType.FirstOrDefaultAsync(x => x.LanguageTypeId == language.Id);

            if (data == null)
            {
                throw new Exception("修改的语种信息不存在!");
            }
            var entity = mapper.Map(language, data);

            entity.ModifyDate = DateTime.Now;
            a35MgeDbContext.Update(entity);
            await a35MgeDbContext.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task Update(MenuRequestDTO menu)
        {
            var data = await a35Mgedbcontext.Menu.FirstOrDefaultAsync(x => x.MenuId == menu.MenuId);

            if (data == null)
            {
                throw new Exception("修改的菜单不存在!");
            }
            var entity = mapper.Map(menu, data);

            entity.ModifyDate = DateTime.Now;
            a35Mgedbcontext.Update(entity);
            await a35Mgedbcontext.SaveChangesAsync();
        }