当我在编辑视图中使用以下代码时,它不会显示模型中的日期.
<input asp-for="OprettetDato" class="form-control"/>
Run Code Online (Sandbox Code Playgroud)
模型的属性声明如下:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0: dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateTime OprettetDato { get; set; }
Run Code Online (Sandbox Code Playgroud)
并且值在模型中传递
为什么这不起作用?
我正在尝试制作一个单词拼图游戏,为此我正在使用递归方法来查找给定字母中的所有可能单词.这些字母是4x4板.
像这样:
ABCD
EFGH
HIJK
LMNO
Run Code Online (Sandbox Code Playgroud)
在这个循环中调用递归方法:
for (int y = 0; y < width; y++)
{
for (int x = 0; x < height; x++)
{
myScabble.Search(letters, y, x, width, height, "", covered, t);
}
}
Run Code Online (Sandbox Code Playgroud)
字母是字符的二维数组.
y&x是显示董事会中的位置的整数
width和height也是int,它表示电路板的尺寸
""是我们试图制作的字符串(单词)
覆盖是一系列bools,以检查我们是否已经使用该方块.
t是一个List(包含要检查的所有单词).
需要优化的递归方法:
public void Search(char[,] letters, int y, int x, int width, int height, string build, bool[,] covered, List<aWord> tt)
{
// Dont get outside the bounds
if (y >= width || y < 0 || x >= …
Run Code Online (Sandbox Code Playgroud)