Esempio n. 1
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            ContentService.Saving += Content_Saving;

            EditorModelEventManager.SendingContentModel += (sender, e) =>
            {
                var node = e.Model.Properties.ToList();

                if (e.Model.IsChildOfListView && e.Model.ContentTypeAlias == "example")
                {
                    string firstNameDecrypted = node.Where(x => x.Alias.ToLower() == "firstname").Select(x => x.Value).First().ToString();

                    var firstName = e.Model.Properties.FirstOrDefault(x => x.Alias.ToLower() == "firstname");

                    //string decryptFirstName = EncryptionDecryption.DecryptString(firstNameDecrypted,"SupplyPassPhrase");
                    string decryptFirstName = EncryptionDecryption.DecryptWithNoPassPhrase(firstNameDecrypted);

                    if (firstName?.Value != null)
                    {
                        firstName.Value = $"{decryptFirstName}";
                    }
                }
            };
        }