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 SomeController:Controller | |
{ | |
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")] | |
public ActionResult NoCache() | |
{ | |
return View(); | |
} | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using NHibernate.Type; | |
using NHibernate.SqlTypes; | |
namespace NHibernate | |
{ | |
/// <summary> |
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
int i = int.MaxValue -50; | |
unchecked { | |
i+= 100; //Will just work | |
} |
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
int i = int.MaxValue -50; | |
checked { | |
i+= 100; // OverflowException: "Arithmetic operation resulted in an overflow." | |
} |
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
$wa = get-SPWebApplication "http://tfssharepoint" | |
Convert-SPWebApplication -Identity $wa -To Claims –RetainPermissions -Verbose | |
$wa.MigrateUsers($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
$url = "http://tfssharepoint/sites/defaultcollection/mynewsite" | |
$projectname = "mynewsite" | |
New-SPWeb -url $url -Name $projectname -Template "Microsoft.TeamFoundation.Sharepoint.Dashboards#0" |
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
$url= "http://tfssharepoint/sites/defaultcollection/sitetoremove" | |
Remove-SPSite $url -confirm:$false |
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
function createDocumentLibrary ($webUrl, $libraryName) | |
{ | |
# varable description | |
$web = Get-SPWeb $webUrl | |
$libraryDescription = "" | |
$libraryTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary; | |
# Adding Library | |
try |
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
using (var context = new SchoolEntities()) | |
{ | |
course = context.Course.Find(4041); | |
// Load the students for a given course | |
context.Entry(course) | |
.Collection(c => c.Students) | |
.Load(); | |
} |