public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
        {
            var username = (string) context["UserName"];
            var userIsAuthenticated = (bool) context["IsAuthenticated"];
            if (string.IsNullOrEmpty(username) || collection.Count < 1)
                return;

            var db = new MyLifeEntities();
            var profile = db.tblProfiles.Where(item => item.UserName == username).FirstOrDefault();
            if (profile == null)
            {
                profile = new tblProfiles {LastUpdatedDate = DateTime.UtcNow};
                db.AddTotblProfiles(profile);
                profile.UserName = username.ToLowerInvariant();
            }

            var names = new StringBuilder();
            var values = new StringBuilder();
            foreach (SettingsPropertyValue property in collection)
            {
                var name = property.Name;
                var value = property.PropertyValue;
                var allowAnonymous = (bool) property.Property.Attributes["AllowAnonymous"];
                if (!userIsAuthenticated && !allowAnonymous) continue;
                if (value == null) continue;
                names.Append(name).Append(";#");
                values.Append(Base64Serializer.Serialize(value)).Append(";#");
            }
            profile.PropertyNames = names.ToString();
            profile.PropertyValues = values.ToString();
            profile.LastUpdatedDate = DateTime.UtcNow;
            db.SaveChanges();
        }