I hereby claim:
- I am marking on github.
- I am mark_ingalls (https://keybase.io/mark_ingalls) on keybase.
- I have a public key ASAuVdU6QtF03i1koCSvsF59q3CQZHVZUsiE0dcy5GBZrAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Stolen from http://ctrlf5.net/?p=263 and http://www.dailycoding.com/posts/convert_image_to_base64_string_and_base64_string_to_image.aspx | |
function ConvertFrom-StringToMemoryStream{ | |
param( | |
[parameter(Mandatory)] | |
[string]$InputString | |
) | |
$stream = New-Object System.IO.MemoryStream; | |
$writer = New-Object System.IO.StreamWriter($stream); | |
$writer.Write($InputString); |
public static IList<T> Get<T, I>() | |
where T : class | |
where I : IRepository<T> | |
{ | |
using (var assembleContainer = BuildAssembleContainer()) | |
{ | |
return assembleContainer.Resolve<I>().List(); | |
} | |
} |
public static void SaveUser(User userToSave) | |
{ | |
using (var assembleContainer = BuildAssembleContainer()) | |
{ | |
var userRepository = assembleContainer.Resolve<IUserRepository>(); | |
var user = userRepository.GetById(userToSave.Id); | |
if (user == null) | |
{ | |
throw new ArgumentException(string.Format("A User with id={0} does not exist in the database", userToSave.Id)); |