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
// Declare constants with a searchable name | |
var MILLISECONDS_PER_DAY = 60 * 60 * 24 * 1000; //86400000; | |
clearBacklog(backlog, MILLISECONDS_PER_DAY); |
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
// In the future we will not remember what 86400000 means. | |
clearBacklog(backlog, 86400000); |
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
[Route("api/[controller]")] | |
public class SecurityController : Controller | |
{ | |
private readonly IAntiforgery _antiforgery; | |
public SecurityController(IAntiforgery antiforgery) | |
{ | |
_antiforgery = antiforgery; | |
} | |
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 ProductModel | |
{ | |
[Display(Name = "Description:")] | |
[AllowHtml] | |
public string Description { 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
<appSettings file="Web.SECRETS.config"> | |
<add key="Database" value="someSecret" /> | |
</appSettings> |
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
<appSettings> | |
<add key="AWS" value="someSecret" /> | |
<add key="Database" value="someKey" /> | |
</appSettings> |
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
// let's say you have a static method called GetProducts() | |
// that returns System.Data.DataTable | |
var products = GetProducts(ModelTypes.Subscription); | |
// how is it clear to the reader that I can do this? | |
return products.Compute("MAX(Price)", String.Empty); |
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 FooController | |
{ | |
public IActionResult Index() | |
{ | |
var fooService = new FooService(new BarService(), new BazService()); | |
return View(fooService.GetFoo()); | |
} | |
} |
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
list = (from ds in dbContext.bytehideServices | |
join c in dbContext.customer on ds.customerName equals c.customerName) | |
Where (ds.shield.number.IndexOf(productLicense.ShieldNumber, StringComparison.OrdinalIgnoreCase) != -1)) |
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
list = (from ds in dbContext.bytehideServices | |
join c in dbContext.customer on ds.customerName equals c.customerName) | |
where (ds.shield.number.ToLower().Contains(productLicense.ShieldNumber.ToLower())) |