Exemple #1
0
        public async Task Delete(string menuId)
        {
            var data = await a35Mgedbcontext.Menu.FirstOrDefaultAsync(x => x.MenuId == menuId);

            a35Mgedbcontext.Remove(data);
            await a35Mgedbcontext.SaveChangesAsync();
        }
Exemple #2
0
        public async Task DeleteLanType(int Id)
        {
            var data = await a35MgeDbContext.LanguageType.FirstOrDefaultAsync(x => x.LanguageTypeId == Id);

            if (data == null)
            {
                throw new Exception("要删除的语种信息不存在!");
            }
            a35MgeDbContext.Remove(data);
            await a35MgeDbContext.SaveChangesAsync();
        }