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 StringBuilderVsStringInterpolation | |
| { | |
| private string data1; | |
| private string data2; | |
| private string data3; | |
| public StringBuilderVsStringInterpolation() | |
| { | |
| data1 = Guid.NewGuid().ToString(); | |
| data2 = Guid.NewGuid().ToString(); |
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
| [Route("api/[controller]/[action]")] | |
| public class ValuesApiController : ApiController | |
| { | |
| [HttpGet] | |
| [ActionName("GetArray")] | |
| public IEnumerable GetArray() | |
| { | |
| return new string[] { "value2", "value3" }; | |
| } |
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 void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
| { | |
| app.UseMvc(routes => | |
| { | |
| routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}"); | |
| }); | |
| } |
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 void ConfigureServices(IServiceCollection services) | |
| { | |
| // Add framework services. | |
| services.AddMvc().AddWebApiConventions(); //Add WebApi | |
| } |
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
| <div *ngIf="userList | async as users; else loading"> | |
| <user-profile *ngFor="let user of users; count as count" [user]="user"> | |
| </user-profile> | |
| <div>{{count}} total users</div> | |
| </div> | |
| <ng-template #loading>Loading...</ng-template> |
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
| npm install | |
| @angular/common@latest | |
| @angular/compiler@latest | |
| @angular/compiler-cli@latest | |
| @angular/core@latest | |
| @angular/forms@latest | |
| @angular/http@latest | |
| @angular/platform-browser@latest | |
| @angular/platform-browser-dynamic@latest | |
| @angular/platform-server@latest |
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
| SELECT STUFF(( | |
| SELECT ','+ cast(Color AS nvarchar(255)) | |
| FROM NameColorTable b | |
| WHERE a.Name = b.Name | |
| FOR XML PATH('')),1,1,'') AS COLUMN2 | |
| FROM NameColorTable a | |
| GROUP BY a.Name |
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
| DECLARE @List VARCHAR(8000) | |
| SELECT @List = COALESCE(@List + ',', '') + CAST(Color AS VARCHAR) | |
| FROM NameColorTable | |
| SELECT @List |
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
| ;WITH myCTE (RowNumber, ProductId, ProductName) | |
| AS ( | |
| SELECT ROW_NUMBER() OVER ( | |
| PARTITION BY ProductName ORDER BY ProductName | |
| ) AS RowNumber , | |
| ProductId ,ProductName FROM #Products | |
| ) | |
| SELECT * FROM myCTE |
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
| let doc = new DOMParser().parseFromString('<div>first div content</div><div>second div content</div>', 'text/html'); | |
| let firstDiv = doc.body.firstChild; | |
| let secondDiv = firstDiv.nextSibling; |