This file contains hidden or 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
Get-ChildItem .\ -include bin,obj,bld,Backup,_UpgradeReport_Files,Debug,Release,ipch -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse } |
This file contains hidden or 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
[TestClass()] | |
public class DateTimeExtTests | |
{ | |
private const int CurrentYear = 2015; | |
private const int CurrentMonth = 3; | |
private const int CurrentDay = 4; | |
private DateTime CurrentDate | |
{ | |
get { return new DateTime(CurrentYear, CurrentMonth, CurrentDay); } |
This file contains hidden or 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
delete a | |
from tbla a | |
inner join tblb b | |
on b.id = a.ID | |
where b.Name = 'Test' |
This file contains hidden or 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 JsonDataReader | |
{ | |
private readonly string baseDir; | |
public JsonDataReader(string directory) | |
{ | |
var dir = Assembly.GetExecutingAssembly().GetDirectory(); | |
baseDir = Path.Combine(dir, directory); | |
} |
This file contains hidden or 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 class AssemblyExt | |
{ | |
public static string GetAssemblyDirectory(this Assembly assembly) | |
{ | |
var uri = new Uri(assembly.CodeBase); | |
return uri.LocalPath; | |
} | |
} |
This file contains hidden or 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 DataModule : Autofac.Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
var asm = Assembly.GetExecutingAssembly(); | |
builder.RegisterAssemblyTypes(asm) | |
.Where(t => t.Name.EndsWith("Repository")) | |
.AsImplementedInterfaces() | |
.InstancePerRequest(); |
This file contains hidden or 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
internal static class QueryableExt | |
{ | |
public static IQueryable<T> IncludeMultiple<T>(this IQueryable<T> query, params Expression<Func<T, object>>[] includes) where T : class | |
{ | |
if (includes == null) | |
return query; | |
foreach (var include in includes) | |
{ | |
query = query.Include(include); |
This file contains hidden or 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 osram_devEntities Create() | |
{ | |
var db = new osram_devEntities(); | |
// By turning off lazy loading entities must be explicitly loaded by using Include(). This means we don't accidently make | |
// calls to the DB that we're not aware of | |
db.Configuration.LazyLoadingEnabled = false; | |
#if DEBUG | |
db.Database.Log = (s) => Debug.WriteLine(s); |
This file contains hidden or 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
<a href="link.html" class="disabled">Link</a> | |
a.disabled { | |
pointer-events: none; | |
cursor: default; | |
} |