Esempio n. 1
0
 public ViewModelNonGenericBase()
 {
     ModelState        = new SimpleModelState();
     KOMapping         = new KOMapping();
     HasDialog         = false;
     HasAlerts         = true;
     Title             = "";
     User              = new LoggedInUserDTO();
     DefaultSammyRoute = "list";
     AllowEditing      = true;
 }
Esempio n. 2
0
        private Dictionary <string, object> GetModelState(IDictionary <string, string[]> failures)
        {
            var result = new Dictionary <string, object>();

            foreach (var key in failures.Keys)
            {
                var errors = failures[key].Select(e => new ModelStateError()
                {
                    ErrorMessage = e
                });
                var state = new SimpleModelState()
                {
                    Errors = errors.ToList(),
                };
                var keys = key.Split(".").Select(k => ToCamelCase(k)).ToArray();

                SetValue(result, keys, state);
            }

            return(result);
        }