Skip to content

Instantly share code, notes, and snippets.

View mgroves's full-sized avatar

Matthew D. Groves mgroves

View GitHub Profile
public override void OnInvoke(MethodInterceptionArgs args)
{
try
{
args.Proceed();
}
catch (Exception ex)
{
var service = args.Instance as ITerritorySerivce;
if(service != null)
public class TerritoryController : Controller
{
readonly ITerritoryService _terrService;
public TerritoryController(ITerritoryService terrService)
{
_terrService = terrService;
_terrService.AddValidationError = x => ModelState.AddModelError("", x);
}
[assembly: ServiceErrorInterceptor(AttributeTargetTypes = "MyProject.Core.Services.*", AspectPriority = 10)]
[Serializable]
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Public)]
public class ServiceErrorInterceptor : MethodInterceptionAspect
{
public override void OnInvoke(MethodInterceptionArgs args)
{
try
{
args.Proceed();
}
[Activity(MainLauncher=true, Label="Terms of Use")]
public class TermsView : MvxActivity
{
public new TermsViewModel ViewModel
{
get { return (TermsViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}
protected override void OnViewModelSet ()
public static class IoC
{
public static IContainer Initialize()
{
ObjectFactory.Initialize(x =>
{
x.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
@mgroves
mgroves / IoC2.cs
Last active August 29, 2015 13:57
public static class IoC
{
public static IContainer Initialize()
{
ObjectFactory.Initialize(x =>
{
x.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
public static class IoC
{
public static IContainer Initialize()
{
ObjectFactory.Initialize(x =>
{
x.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
public class BlobCloudService
{
readonly CloudBlobContainer _container;
public BlobCloudService()
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("your connection string");
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
_container = blobClient.GetContainerReference("your container name");
}
me@MYCOMPUTER /d/zproj/NuGetGallery (master)
$ git stash
Saved working directory and index state WIP on master: a627dcf Merge remote-trac
king branch 'upstream/master'
HEAD is now at a627dcf Merge remote-tracking branch 'upstream/master'
me@MYCOMPUTER /d/zproj/NuGetGallery (master)
$ git status
# On branch master
nothing to commit, working directory clean