Example #1
0
        public async Task Put(Userinfo o)
        {
            var entity = _context.Users.Find(o.Id);
            var d      = o.GetType().GetProperties().Where(n => n.GetValue(o, null) != null);

            foreach (var item in d)
            {
                entity.GetType().GetProperties().Where(n => n.PropertyType.Equals(item.PropertyType));
            }
            entity.Username = o.Username;
            _context.Users.Update(o);
            await _context.SaveChangesAsync();
        }