git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| void Main() | |
| { | |
| } | |
| // Define other methods and classes here | |
| public static class SelectListExtensionMethods | |
| { | |
| /// <summary> | |
| /// The SelectListItem to use by default as the placeholder for any select lists generated by these extension methods. |
| public static class SelectListExtensionMethods | |
| { | |
| //// simple Enum for demonstration in the examples | |
| //enum Colors { | |
| // Red = 1, | |
| // Green = 2, | |
| // Blue = 3 | |
| //} | |
| //// Simple Class for demonstration in the examples |
| public static class SelectListExtensionMethods | |
| { | |
| //// simple Enum for demonstration in the examples | |
| //enum Colors { | |
| // Red = 1, | |
| // Green = 2, | |
| // Blue = 3 | |
| //} | |
| //// Simple Class for demonstration in the examples |
| using System.Collections.Specialized; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using System.Web.Routing; | |
| namespace My.App | |
| { | |
| public static class Extensions | |
| { | |
| /// <summary> |
| // Setup CSRF safety for AJAX: | |
| $.ajaxPrefilter(function(options, originalOptions, jqXHR) { | |
| if (options.type.toUpperCase() === "POST") { | |
| // We need to add the verificationToken to all POSTs | |
| var token = $("input[name^=__RequestVerificationToken]").first(); | |
| if (!token.length) return; | |
| var tokenName = token.attr("name"); | |
| namespace ExampleProject.Controllers | |
| { | |
| public class HomeController : Controller | |
| { | |
| [HttpGet] | |
| public ActionResult Index() | |
| { | |
| return View(); | |
| } |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
| "http://www.w3.org/TR/html4/strict.dtd"> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>untitled</title> | |
| <meta name="generator" content="TextMate http://macromates.com/"> | |
| <meta name="author" content="David Mosher"> | |
| <!-- Date: 2010-11-18 --> |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| // Single Key | |
| ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
| customer => customer.Code); | |
| // Surrogate Key (with anonymous type) | |
| ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
| customer => new { customer.Code1, customer.Code2, customer.Code3 }); |
| // DON'T add the key if auto-generated | |
| ctx.BulkInsert(customers, operation => operation.ColumnInputExpression = | |
| customer => new {customer.Name, customer.Email}); | |
| // ALWAYS add the key | |
| ctx.BulkUpdate(customers, operation => operation.ColumnInputExpression = | |
| customer => new { customer.ID, customer.Name, customer.Email }); | |
| // ALWAYS add the key | |
| ctx.BulkMerge(customers, operation => operation.ColumnInputExpression = |