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
var products = [ | |
{ | |
id: 1, | |
name: 'IPhone X', | |
price: 900 | |
}, | |
{ | |
id: 2, | |
name: 'Samsung S8', | |
price: 700 |
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
import React from 'react' // npm package of react is required | |
import ReactDOM from 'react-dom' // npm package of react-dom | |
class Clock extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h2>Hello world, Its {this.props.date.toLocaleString()}</h2> | |
</div> | |
); |
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
import React from 'react'; // npm install react | |
import ReactDOM from 'react-dom'; // npm install react-dom | |
class Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
date: new Date() | |
}; |
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
import React from 'react'; | |
export default Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
date: new Date(), | |
isClockRunning: true | |
} |
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 Program | |
{ | |
public static void Main(string[] args) | |
{ | |
BuildWebHost(args).Run(); | |
} | |
public static IWebHost BuildWebHost(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Startup>() |
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 static IWebHostBuilder CreateDefaultBuilder(string[] args) | |
{ | |
var builder = new WebHostBuilder() | |
.UseKestrel((builderContext, options) => | |
{ | |
options.Configure(builderContext.Configuration.GetSection("Kestrel")); | |
}) | |
.UseContentRoot(Directory.GetCurrentDirectory()) | |
.ConfigureAppConfiguration((hostingContext, config) => | |
{ |
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 | |
{ | |
// Use this method to add services to the container. | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddSingleton<IDependecy, Dependency>() | |
.AddScoped<UserManager<AppUser>>() | |
.AddTransient<IUserClaimsPrincipalFactory<AppUser>, AppUserClaimsPrincipalFactory>(); | |
} |
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
mockSet.Setup(db => db.AsQueryable()).Returns(books); |
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
mockSet.As<IQueryable<Book>>().Setup(m => m.Provider).Returns(books.Provider); | |
mockSet.As<IQueryable<Book>>().Setup(m => m.Expression).Returns(books.Expression); | |
mockSet.As<IQueryable<Book>>().Setup(m => m.ElementType).Returns(books.ElementType); | |
mockSet.As<IQueryable<Book>>().Setup(m => m.GetEnumerator()).Returns(books.GetEnumerator()); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>React with Typescript and Webpack</title> | |
</head> | |
<body> | |
<div id="root"></div> |
OlderNewer