This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultPageRouteModelConvention : IPageRouteModelConvention | |
{ | |
public void Apply(PageRouteModel model) | |
{ | |
if (model.RelativePath == "/Pages/Index.cshtml") | |
{ | |
var currentHomePage = model.Selectors.Single(s => s.AttributeRouteModel.Template == string.Empty); | |
model.Selectors.Remove(currentHomePage); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HtmlTargetElement("bold",Attributes = "bold")] | |
public class BoldTagHelper : TagHelper | |
{ | |
public override void Process(TagHelperContext context, TagHelperOutput output) | |
{ | |
output.Attributes.RemoveAll("bold"); | |
output.PreContent.SetHtmlContent("<strong>"); | |
output.PostContent.SetHtmlContent("</strong>"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
bool isChecked = false; | |
if (string.IsNullOrWhiteSpace(ViewData.TemplateInfo.FormattedModelValue.ToString())==false) | |
{ | |
isChecked = !string.IsNullOrWhiteSpace(ViewData.TemplateInfo.FormattedModelValue.ToString()) && Convert.ToBoolean(ViewData.TemplateInfo.FormattedModelValue); | |
} | |
var dic = new Dictionary<string, string> { }; | |
var attributes = ViewData.MergeAttributes(dic); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.Hidden("ajaxUrl",Url.Action("")) | |
<button type="button" data-ajax-url="@Url.Action("")"></button> | |
<script> | |
$(function () { | |
$(":input[data-ajax-url]").click(function (e) { | |
e.preventDefault(); | |
var current = $(this); | |
$.ajax({ | |
type: "POST", | |
url: current.data("url"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var testSource = LookUp(); | |
testSource.Dump(); | |
} | |
IEnumerable<DepositModels> LookUp() | |
{ | |
for (int i = 0; i < 3; i++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Order | |
{ | |
Ascending, | |
Descending | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static string GetNoLastNumber(int? random = null) | |
{ | |
var dictionary = new[] { "a", "b", "c", "d", "e", "f", "g", "h", "k", "m", "p", "r" }; | |
if (random.HasValue==false) | |
{ | |
random = new Random().Next(0, 9); | |
} | |
return dictionary[random.Value]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NSubstitute; | |
using NSubstitute.Exceptions; | |
namespace MVP2016 | |
{ | |
[TestClass] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task("前端:darkCSS", function () { | |
gulp.src( | |
[ | |
paths.cssSource + "theme-dark.css" | |
]) | |
.pipe(concat(paths.assets + "css/theme-dark.css")) | |
.pipe(minifycss()) | |
.pipe(gulp.dest(".")) | |
.pipe(notify({ message: "前端:darkCSS" })); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsonstring="[{中文="A"},{中文="B"}]" | |
class JsonForSearch | |
{ | |
[JsonProperty("中文")] | |
public string pname { get; set; } | |
} | |
反序列化要吃的到 | |
再次序列化的值希望是 |
NewerOlder