示例#1
0
        public async Task <int> UserEdit(usersModel bjm)
        {
            users us = new users()
            {
                user_id        = bjm.User_id,
                user_name      = bjm.User_name,
                user_password  = bjm.User_password,
                user_true_name = bjm.User_true_name,
                user_identity  = bjm.user_identity
            };

            tesc.Attach(us);
            tesc.Entry(us).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            return(await tesc.SaveChangesAsync());
        }
示例#2
0
        //修改
        public async Task <int> Update(config_file_first_kindModel1 cffkm)
        {
            config_file_first_kind cffk = new config_file_first_kind()
            {
                ffk_id               = cffkm.ffk_id,
                first_kind_id        = cffkm.first_kind_id,
                first_kind_name      = cffkm.first_kind_name,
                first_kind_salary_id = cffkm.first_kind_salary_id,
                first_kind_sale_id   = cffkm.first_kind_sale_id
            };

            //tescDbContext.Attach(cffk);
            //tescDbContext.Entry(cffk).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            //return await tescDbContext.SaveChangesAsync();

            tescDbContext.Attach(cffk);
            tescDbContext.Entry(cffk).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            return(await tescDbContext.SaveChangesAsync());
        }