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
private Audit ConfigureAudit() | |
{ | |
var audit = new Audit(); | |
audit.CreatedBy = UserName; | |
audit.Configuration.Exclude<Product>(); | |
return audit; | |
} |
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
CREATE TABLE dbo.Products | |
( | |
[Id] int IDENTITY(1,1) PRIMARY KEY, | |
[Name] nvarchar(250) NOT NULL, | |
[Description] varchar(max) NULL, | |
[ValidFrom] datetime2 (2) GENERATED ALWAYS AS ROW START, | |
[ValidTo] datetime2 (2) GENERATED ALWAYS AS ROW END, | |
PERIOD FOR SYSTEM_TIME (ValidFrom, ValidTo) | |
) | |
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = dbo.ProductsHistory)); |
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 partial class AddDescriptionToProduct : DbMigration | |
{ | |
public override void Up() | |
{ | |
AddColumn("dbo.Products", "Description", c => c.String()); | |
//AddColumn("dbo.ProductsHistory", "Description", c => c.String()); | |
} | |
public override void Down() | |
{ |
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 partial class AddOrder : DbMigration | |
{ | |
public override void Up() | |
{ | |
CreateTable( | |
"dbo.Orders", | |
c => new | |
{ | |
Id = c.Int(nullable: false, identity: true), | |
Number = c.String(), |
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
@page "/counter" | |
<h1>Counter</h1> | |
<p>Current count: @currentCount</p> | |
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button> | |
@functions { | |
int currentCount = 0; |
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 BaseModel | |
{ | |
public BaseModel() | |
{ | |
IsActive = true; | |
} | |
public int Id { get; set; } | |
public bool IsActive { get; set; } |
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 CacheDemo | |
{ | |
public void Run() | |
{ | |
WithCache(); | |
} | |
private void WithCache() | |
{ | |
using (var db = new DataContext()) |
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
class OperationDemo | |
{ | |
public void Run() | |
{ | |
var expression = new Expression() | |
{ | |
Arg1 = 10, | |
Arg2 = 5, | |
Operator = "/" | |
}; |
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
@page "/fetchdata" | |
@inject IWeatherForecastService Service | |
<h1>Weather forecast</h1> | |
<p>This component demonstrates fetching data from the server.</p> | |
@if (forecasts == null) | |
{ | |
<p><em>Loading...</em></p> |
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
@page "/fetchdata" | |
@using CsvHelper | |
@using System.IO | |
@using System.Text | |
@inject IWeatherForecastService Service | |
@inject IFileService FileService | |
<h1>Weather forecast</h1> | |
<p>This component demonstrates fetching data from the server.</p> |