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
Microsoft Visual Studio Solution File, Format Version 11.00 | |
# Visual Studio 2010 | |
Global | |
GlobalSection(SolutionProperties) = preSolution | |
HideSolutionNode = FALSE | |
EndGlobalSection | |
EndGlobal |
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
/// <summary> | |
/// Domain Event | |
/// </summary> | |
public class CustomerChangeLevel : EventArgs { | |
public decimal Amount { get; set; } | |
} | |
/// <summary> | |
/// Simple Enum | |
/// </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
public class ServiceResolverAdapter : IDependencyResolver | |
{ | |
private readonly System.Web.Mvc.IDependencyResolver dependencyResolver; | |
public ServiceResolverAdapter(System.Web.Mvc.IDependencyResolver dependencyResolver) | |
{ | |
if (dependencyResolver == null) throw new ArgumentNullException("dependencyResolver"); | |
this.dependencyResolver = dependencyResolver; | |
} |
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 Raven.Abstractions.Indexing; | |
using Raven.Client; | |
using Raven.Client.Document; | |
using Raven.Client.Indexes; | |
using Raven.Client.Linq; | |
namespace RavenDBProjectionTest |
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 IList<TRes> ListAs<TRes>(this IQueryOver qry, TRes resultByExample) | |
{ | |
var ctor = typeof (TRes).GetConstructors().First(); | |
return qry.UnderlyingCriteria | |
.SetResultTransformer(Transformers.AliasToBeanConstructor(ctor)) | |
.List<TRes>(); | |
} | |
[Fact] | |
public void ListAs_Should_CastQueryOverResultToTypeSameAsSupliedExampleInstance() |
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 LinqToSqlRepository<TContext> | |
: IDisposable where TContext : DataContext, new() | |
{ | |
private readonly DataContext _dc; | |
public LinqToSqlRepository() | |
{ | |
_dc = new TContext(); | |
} |
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
private static readonly object GeneratorLock = new object(); | |
///<summary> | |
/// Create the next id (numeric) | |
///</summary> | |
private int NextAccountNumber() | |
{ | |
lock (GeneratorLock) | |
{ | |
using (new TransactionScope(TransactionScopeOption.Suppress)) |
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 interface IObjectContext : IDisposable | |
{ | |
ObjectContextOptions ContextOptions { get; } | |
TEntity CreateObject<TEntity>() where TEntity : class; | |
IObjectSet<TEntity> CreateObjectSet<TEntity>() where TEntity : class; | |
int SaveChanges(); | |
} |
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.Data.Common; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Data.Objects; | |
using NUnit.Framework; | |
namespace MyPrj.Infrastructure.IntegrationTests | |
{ | |
/// <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
// client side logging | |
window.console = window.console || function () { var a = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var b = 0; b < a.length; ++b) window.console[a[b]] = function () { } } (); | |
// server side logging | |
window.onerror = function (msg, url, line) { | |
if (encodeURIComponent && window.XMLHttpRequest && window.navigator) { | |
try { | |
var req = new XMLHttpRequest(); | |
var params = "agent=" + navigator.userAgent + "&line=" + line + "&msg=" + msg + "&url=" + encodeURIComponent(url); | |
req.open("POST", "/LogJs.aspx", true); |
OlderNewer