Skip to content

Instantly share code, notes, and snippets.

@djmnz
djmnz / Program.cs
Last active April 20, 2016 06:09
Cached error from MassTransit 3.2.4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MassTransit;
using MassTransit.AzureServiceBusTransport;
using MassTransit.Util;
using Microsoft.ServiceBus;
@djmnz
djmnz / BusConsumerModule.cs
Created February 18, 2016 04:09
MassTransit + AzureServiceBus + AutoFac
using System;
using System.Collections.Generic;
using Autofac;
using MassTransit;
using MassTransit.AutofacIntegration;
using MassTransit.AzureServiceBusTransport;
using Microsoft.ServiceBus;
namespace StarNow.Events.Core.Configuration
{
@djmnz
djmnz / gist:8411143
Last active January 3, 2016 04:49
Creating a class level validation attribute ASP.Net MVC
[EndDateValidation]
public class CustomDate
{
[DisplayFormat(DataFormatString = "0:dd-MM-yyyy}")]
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
[Required]
public string Test { get; set; }
@djmnz
djmnz / gist:8190656
Last active December 19, 2023 09:56
Getting object size from C# AWS SDK without downloading it
using (var amazonClient = new AmazonS3Client())
{
var getObjectMetadataRequest = new GetObjectMetadataRequest() { BucketName = RawBucketName, Key = fileName };
var meta = amazonClient.GetObjectMetadata(getObjectMetadataRequest);
var fileSize = meta.Headers.ContentLength;
}