public ActionResult Index()
        {
            RepositoryService.CreateDefaultObject("Account");
            RepositoryService.AddField("Account", "AccountName", "varchar(255)");
            RepositoryService.Insert("INSERT INTO Account (AccountName) VALUES ('Test')");
            var accounts = RepositoryService.Select <dynamic>("SELECT * FROM Account");

            return(View(accounts));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            RepositoryService.CreateDefaultObject("Account");
            RepositoryService.AddField("Account", "FirstName", "varchar(255)");
            RepositoryService.Insert("INSERT INTO Account (FirstName) VALUES ('Test " + DateTime.Now.ToString() + "')");
            var accounts = RepositoryService.Select <dynamic>("SELECT * FROM Account");
            var list     = new List <Dictionary <string, string> >();

            foreach (var account in accounts)
            {
                var dictionary = new Dictionary <string, string>();
                foreach (KeyValuePair <string, object> kv in account)
                {
                    dictionary[kv.Key] = kv.Value?.ToString();
                }
                list.Add(dictionary);
            }
            return(View(list));
        }