学海无涯

导航

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页

2023年2月14日 #

View 视图

摘要: 在布局模板 _layout.html 中添加公共模块 @await RenderSectionAsync("bottom",false); 在Action 视图 .cshtml 文件中引用 @section bottom { <div> <p>我是页脚 bootom 模块 </p> </div> } 阅读全文

posted @ 2023-02-14 10:33 宁静致远. 阅读(32) 评论(0) 推荐(0)

2023年2月10日 #

MVC Core CURD

摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 5 using Microsoft.AspNetCore.Mvc; 6 using Mic 阅读全文

posted @ 2023-02-10 17:02 宁静致远. 阅读(21) 评论(0) 推荐(0)

模型特性

摘要: DisplayFormat 特性用于显式指定日期格式: [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] public DateTime ReleaseDate { get; set; 阅读全文

posted @ 2023-02-10 16:01 宁静致远. 阅读(20) 评论(0) 推荐(0)

向数据库中添加种子数据

摘要: 在Models目录下添加SeedData类 1 using Microsoft.EntityFrameworkCore; 2 using MvcMovie.Data; 3 4 namespace MvcMovie.Models 5 { 6 public static class SeedData 7 阅读全文

posted @ 2023-02-10 10:16 宁静致远. 阅读(36) 评论(0) 推荐(0)

.Net Core 技巧

摘要: 设置属性的日期类型 ReleaseDate 上的 DataType 特性指定了数据的类型 (Date)。 通过此特性: 用户无需在日期字段中输入时间信息。 仅显示日期,而非时间信息。 [DataType(DataType.Date)] public DateTime Date { get; set; 阅读全文

posted @ 2023-02-10 08:39 宁静致远. 阅读(47) 评论(0) 推荐(0)

2023年2月7日 #

MVC控件器动作 返回类型 IActionResult

摘要: 1 using Microsoft.AspNetCore.Mvc; 2 using System.Diagnostics; 3 using System.Text; 4 using TestMvcWebApplication.Models; 5 6 namespace TestMvcWebAppli 阅读全文

posted @ 2023-02-07 15:04 宁静致远. 阅读(95) 评论(0) 推荐(0)

2023年2月4日 #

ASP.NET Core Web API 中控制器操作的返回类型

摘要: ASP.NET Core Web API 中控制器操作的返回类型 ASP.NET Core为 Web API 控制器操作返回类型提供以下选项: 特定类型 IActionResult ActionResult<T> HttpResults 特定类型 最基本的操作返回基元或复杂数据类型,例如, stri 阅读全文

posted @ 2023-02-04 21:52 宁静致远. 阅读(218) 评论(0) 推荐(0)

2023年2月3日 #

将WPF项目更改为Prism项目

摘要: 1.创建一个基于.NetFramework或.NetCore的WPF应用程序。 2.在NuGet管理器中添加 Prism.Dryloc包 3.修改 App.xaml 的基类为PrismApplication /// <summary> /// Interaction logic for App.xa 阅读全文

posted @ 2023-02-03 15:30 宁静致远. 阅读(116) 评论(0) 推荐(0)

Prism 资源

摘要: Github:https://github.com/PrismLibrary/Prism NuGet:https://www.nuget.org/packages/prism.wpf 安装 Prism 项目模板:打开VS,菜单:扩展-->管理扩展,搜索 Prism WPF入门基础教程系列 https 阅读全文

posted @ 2023-02-03 15:19 宁静致远. 阅读(61) 评论(0) 推荐(0)

2023年1月28日 #

算法面试题

摘要: 有一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30位数是多少,用递归算法实现。 1 int Add(int number) 2 { 3 if (number <= 0) 4 { 5 return 0; 6 } 7 else if (number <= 2) 8 re 阅读全文

posted @ 2023-01-28 16:45 宁静致远. 阅读(81) 评论(0) 推荐(0)

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页