public void SaveUser(User user)
        {
            Mapper.CreateMap<User, Users>();
            var users = Mapper.Map<User, Users>(user);

            using (var rng = new RNGCryptoServiceProvider())
            {
                byte[] data = new byte[4];

                // Ten iterations.
                for (int i = 0; i < 10; i++)
                {
                    // Fill buffer.
                    rng.GetBytes(data);

                    // Convert to int 32.
                    int value = BitConverter.ToInt32(data, 0);
                    Console.WriteLine(value);
                }
            }

            using (var entities = new anmatiEntities())
            {
                if (user.Id != 0)
                {
                    entities.Users.Attach(users);
                }
                else
                {
                    entities.Users.Add(users);
                }

                entities.SaveChanges();
            }
        }