Update Test Site

+ Localized everything - No external resources required on the front-end
 + `test123` tested Layouts with relative paths.. issue is, its always relative from root
This commit is contained in:
Kaveman
2024-08-18 03:27:36 -07:00
parent 27fe310191
commit a92acf0597
12 changed files with 127 additions and 37 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Text;
namespace WebServer.Extensions {
public static class ExpandoObjectExt {
public static object GetPropertyOrDefault(this ExpandoObject expando, string propertyName, object defaultValue) {
if (expando is IDictionary<string, object> dict) {
if (!dict.TryGetValue(propertyName, out var result))
dict.Add(propertyName, result = defaultValue);
return result;
}
return defaultValue;
}
public static bool TryGetProperty(this ExpandoObject expando, string propertyName, out object value) {
value = null;
return expando is IDictionary<string, object> dict
&& dict.TryGetValue(propertyName, out value);
}
}
}