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
const string connectionstring = @"Server=myserver;Database=mydb;Trusted_Connection=True;Connection Timeout=30;"; | |
string dependsSql = @" | |
select t.name as TableWithForeignKey, fk.constraint_column_id as FK_columns , c.name as ForeignKeyColumn | |
from sys.foreign_key_columns as fk | |
inner join sys.tables as t on fk.parent_object_id = t.object_id | |
inner join sys.columns as c on fk.parent_object_id = c.object_id and fk.parent_column_id = c.column_id | |
where fk.referenced_object_id = (select object_id from sys.tables where name = @tablename) | |
order by TableWithForeignKey"; | |
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 PromiseHelper(){} | |
PromiseHelper.sequentialProcess = function(promises) { | |
if(promises.length && promises.length > 0){ | |
return promises.reduce( function( current, acc ) { | |
return current.then(acc); | |
}); | |
}else { | |
return $.when(); | |
} |
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
const string myprop = "myprop"; | |
const string myvalue = "myvalue"; | |
var manager = new Manager(new System.IO.DirectoryInfo(@"C:\temp\cbldb"), ManagerOptions.Default); | |
var db = manager.GetDatabase("test"); | |
var newdoc = db.CreateDocument(); | |
var props = new Dictionary<string, object> | |
{ | |
{myprop, myvalue } |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<connectionStrings> | |
<add name="mongolog" connectionString="{mymongoconnectionstring}"/> | |
</connectionStrings> | |
<appSettings> |
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
const int iterations = 10; | |
const int inserts = 1000000; | |
const string mongodbname = "perftest"; | |
private SqlConnection sqlConnection; | |
private MongoDatabase mongoDb; | |
private List<Result> allresults = new List<Result>(); | |
#region setup-teardown | |
private void Setup(){ | |
sqlConnection = new SqlConnection(Connection.ConnectionString); |
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
$('table.arrow-nav').keydown(function(e){ | |
var $table = $(this); | |
var $active = $('input:focus,select:focus',$table); | |
var $next = null; | |
var focusableQuery = 'input:visible,select:visible,textarea:visible'; | |
var position = parseInt( $active.closest('td').index()) + 1; | |
console.log('position :',position); | |
switch(e.keyCode){ | |
case 37: // <Left> | |
$next = $active.parent('td').prev().find(focusableQuery); |
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
void Main() | |
{ | |
var contact = new Contact{ | |
FirstName = "John", | |
LastName = "Smith", | |
HomePhone = new Phone{ | |
Number = "303-123-1234" | |
} | |
}; |
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
void Main() | |
{ | |
var contact = new Contact{ | |
FirstName = "John", | |
LastName = "Smith" | |
}; | |
var sourceXml = ToXml(contact); | |
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.ComponentModel.DataAnnotations; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System; | |
public interface ISelectiveDisplay { | |
bool IsVisible { get; set; } | |
ICollection<string> PropertiesToHide { get; } | |
} |
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
@model object | |
@{ | |
ViewBag.Title = "Object Information"; | |
} | |
@if(!Model.GetType().Name.Contains("Anonymous")){ | |
} | |
@foreach (var prop in Model.GetType().GetProperties()) |
NewerOlder