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
### Keybase proof | |
I hereby claim: | |
* I am rodh257 on github. | |
* I am rodh257 (https://keybase.io/rodh257) on keybase. | |
* I have a public key ASC991rqSF5IdhmoplmPbuAw_WSI61Zp_7iR-vXlYNwbggo | |
To claim this, I am signing this object: |
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 vogels = require('vogels'); | |
const Joi = require('joi'); | |
const AWS = require('aws-sdk'); | |
// setup Vogels | |
vogels.log.level('debug'); | |
vogels.AWS.config.update({ | |
region: 'us-west-1', | |
}); |
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 class GetFullImagePath | |
{ | |
public static string ForFileName (string fileName) | |
{ | |
//Any old images with a full file path stored should have the front part removed | |
if (fileName.Contains ("/")) | |
{ | |
fileName = fileName.Substring (fileName.LastIndexOf ("/") + 1); | |
} | |
var docsDir = Environment.GetFolderPath (Environment.SpecialFolder.Personal); |
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
static int[] Detach<TEntity>( | |
this IUnitOfWork unitOfWork, Func<TEntity, bool> where, Func<TEntity, int> getKey = null) | |
where TEntity : EntityObject | |
{ | |
if (!(unitOfWork is ObjectContext)) | |
{ | |
return new int[0]; | |
} | |
var objectContext = ((ObjectContext)unitOfWork); |
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 Mock<IUnitOfWork> SetupAllObjectSets(this Mock<IUnitOfWork> mock) | |
{ | |
var properties = typeof(IUnitOfWork).GetProperties(); | |
foreach (var property in properties) | |
{ | |
//IObjectSet<Of Something> | |
var genericType = property.PropertyType.GetGenericTypeDefinition(); | |
if (genericType == typeof(System.Data.Objects.IObjectSet<>)) | |
{ | |
//Gets the <T> out of IObjectSet<T> |