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 void BulkInsert<T>(string connection, string tableName, IList<T> list) | |
{ | |
using (var bulkCopy = new SqlBulkCopy(connection)) | |
{ | |
bulkCopy.BatchSize = list.Count; | |
bulkCopy.DestinationTableName = tableName; | |
var table = new DataTable(); | |
var props = TypeDescriptor.GetProperties(typeof(T)) | |
//Dirty hack to make sure we only have system data types |
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 imports = new List<Product>(); | |
//Load up the imports | |
//Pass in cnx, tablename, and list of imports | |
BulkInsert(context.Database.Connection.ConnectionString, "Products", imports); |
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
[TestFixture] | |
public class QuerySomeView | |
{ | |
[Test] | |
public void DoIt() | |
{ | |
var context = new StoreContext(); | |
var results = context.Database.SqlQuery<ReadModel>("SELECT * FROM SomeView").ToList(); | |
Assert.AreEqual(results.Count(), 2); | |
} |
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 FaxController : Controller | |
{ | |
public void Receipt(FormCollection faxreceipt) | |
{ | |
var direction = faxreceipt["direction"]; | |
var isTest = faxreceipt["is_test"]; | |
var faxData = faxreceipt["fax"]; | |
var fax = JsonConvert.DeserializeObject<Fax>(faxData); | |
//do something w/ fax |
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 fax = new Dictionary<string, string> | |
{ | |
{"to", 8885551212}, | |
{"string_data", "<div>This is your fax in html, will fax just like it renders in webkit, cool huh?</div>")}, | |
{"string_data_type", "html"}, | |
{"api_key", apiKey}, | |
{"api_secret", apiSecret}, | |
{"callback_url", "http://yourwebsite.com/fax/receipt"} | |
}; |
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
/* | |
* jQuery Mobile Framework 1.0.1 | |
* http://jquerymobile.com | |
* | |
* Copyright 2011-2012 (c) jQuery Project | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
*/ |
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
/* | |
* jQuery Mobile Framework 1.1.1 1981b3f5ec22675ae47df8f0bdf9622e7780e90e | |
* http://jquerymobile.com | |
* | |
* Copyright 2012 jQuery Foundation and other contributors | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
*/ | |
/* Swatches */ |