This file contains 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
Test |
This file contains 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
@page "/test/tag" | |
@{ | |
ViewData["Title"] = "UserPartialView"; | |
var watch = System.Diagnostics.Stopwatch.StartNew(); | |
int count = 10000; | |
} | |
<h2>Performance Test : TagHelper</h2> | |
<hr /> | |
@for (int i = 1; i < count+1; i++) |
This file contains 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
@page "/test/partial" | |
@{ | |
ViewData["Title"] = "UserPartialView"; | |
var watch = System.Diagnostics.Stopwatch.StartNew(); | |
int count = 10000; | |
} | |
<h2>Performance Test : Partial View</h2> | |
<hr /> | |
@for (int i = 1; i < count + 1; i++) | |
{ |
This file contains 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
<i class="fa fa-star" style="color:#ffd800"></i> | |
<i class="fa fa-star" style="color:#ffd800"></i> | |
<i class="fa fa-star" style="color:#ffd800"></i> | |
<i class="fa fa-star-o"></i> | |
<i class="fa fa-star-o"></i> |
This file contains 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 Microsoft.AspNetCore.Razor.TagHelpers; | |
namespace Codehaks.TagHelpers | |
{ | |
public class StarsTagHelper : TagHelper | |
{ | |
public int Level { get; set; } | |
public override void Process(TagHelperContext context, TagHelperOutput output) | |
{ |
This file contains 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
@model int | |
@for (var i = 0; i < 5; i++) | |
{ | |
if (i < Model) | |
{ | |
<i class="fa fa-star" style="color:#ffd800"></i> | |
} | |
else | |
{ | |
<i class="fa fa-star-o"></i> |
This file contains 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 Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc(); | |
services.AddDbContext<AppDbContext>(options => | |
options.UseSqlite("Data Source=app.db")); |
This file contains 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 Compare | |
{ | |
public IActionResult ToLower() | |
{ | |
var all = _db.Users.ToList(); | |
var now = DateTime.Now; | |
int jacksCount = 0; | |
for (int i = 0; i < 1000; i++) |
This file contains 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 LiteDbConfig | |
{ | |
public string DatabasePath { get; set; } | |
} |
This file contains 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 LiteDB; | |
using Microsoft.Extensions.Options; | |
using System; | |
namespace BugPages.Common | |
{ | |
public class LiteDbContext | |
{ | |
public readonly LiteDatabase Context; | |
public LiteDbContext(IOptions<LiteDbConfig> configs) |