Exemple #1
0
        public async Task <bool> EditUserName(string userId, string name)
        {
            var userInfo = new UserInfo {
                Id = userId, UserName = name
            };

            dbContext.Attach(userInfo);
            dbContext.Entry(userInfo).Property(p => p.UserName).IsModified = true;
            var c = await dbContext.SaveChangesAsync();

            return(c == 1);
        }