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
| new Vue({ | |
| el: '#app', | |
| data: { | |
| message: 'Hello World, Vue.js!' | |
| } | |
| }) |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <script src="https://unpkg.com/vue"></script> | |
| <script src="app.js"></script> | |
| </head> | |
| <body> | |
| <div id="app"> | |
| <p>{{ message }}</p> | |
| </div> |
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
| apiVersion: apps/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: azure-container-service-poc | |
| spec: | |
| replicas: 1 | |
| strategy: | |
| rollingUpdate: | |
| maxSurge: 1 | |
| maxUnavailable: 1 |
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 Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var summary = BenchmarkRunner.Run(typeof(EFCore2VsDapper)); | |
| Console.ReadLine(); | |
| } | |
| } |
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 EFCore2VsDapper | |
| { | |
| EFRepository _EFRepo; | |
| DapperRepository _DapperRepo; | |
| public EFCore2VsDapper() | |
| { | |
| _EFRepo = new EFRepository(); | |
| _DapperRepo = new DapperRepository(); | |
| } |
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 DapperRepository | |
| { | |
| public List<Product> GetAllProductsByCategory(int categoryId) | |
| { | |
| using (IDbConnection db = new SqlConnection(@"Connection String")) | |
| { | |
| return db.Query<Product> | |
| ($"SELECT * From [SalesLT].[Product] INNER JOIN [SalesLT].[ProductCategory] ON [SalesLT].[ProductCategory].ProductCategoryId = [SalesLT].[Product].ProductCategoryId WHERE [SalesLT].[ProductCategory].ProductCategoryId ={categoryId}").ToList(); | |
| } |
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 EFRepository | |
| { | |
| public List<Product> GetAllProductsByCategory(int categoryId) | |
| { | |
| using (var db = new EFCore2TestContext()) | |
| { | |
| var products = db.Product | |
| .Where(b => b.ProductCategoryId == categoryId) | |
| .OrderBy(b => b.ProductNumber) | |
| .Include(p => p.ProductCategory) |
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 Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var baseUrl = "http://YOUR_HOST_NAME/"; | |
| var httpClientHelper = new HttpClientHelper(); | |
| var tokenRequest = new List<KeyValuePair<string, string>>() | |
| { | |
| new KeyValuePair<string, string>("grant_type","password"), |
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
| // 1. includes (introduced in ES6) | |
| var string = "string to search for substring", | |
| substring = "sea"; | |
| string.includes(substring); | |
| // 2. RegExp: test | |
| var string = "string to search for substring", | |
| expr = /sea/; // no quotes here | |
| expr.test(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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var summary = BenchmarkRunner.Run<StringFormatVsStringInterpolation>(); | |
| summary = BenchmarkRunner.Run<StringConcatVsStringInterpolation>(); | |
| summary = BenchmarkRunner.Run<StringBuilderVsStringInterpolation>(); | |
| } |