Skip to content

Instantly share code, notes, and snippets.

View alexeyzimarev's full-sized avatar
🎖️
Protecting common sense

Alexey Zimarev alexeyzimarev

🎖️
Protecting common sense
View GitHub Profile
@alexeyzimarev
alexeyzimarev / gist:9930005
Created April 2, 2014 08:14
Initialize AutofacDependencyResolver for ReactiveUI sample
// this is your bootstrapper
var builder = new ContainerBuilder();
builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly()).AsImplementedInterfaces();
// some other registrations here
var container = builder.Build();
RxAppAutofacExtension.UseAutofacDependencyResolver(container);
namespace crap
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
public class PartialAppPlayground
public class GetEventStoreEventDispatcher
{
private readonly IEventBus _eventBus;
private readonly EventStoreConnection _connection;
private bool _stopRequested;
private EventStoreAllCatchUpSubscription _subscription;
private readonly IPersistGetEventStorePosition _positionRepository;
public GetEventStoreEventDispatcher(EventStoreConnection connection, IEventBus eventBus, IPersistGetEventStorePosition positionRepository)
public class AutofacIocAdapter : IContainerAdapter
{
private readonly IContainer _container;
public AutofacIocAdapter(IContainer container)
{
_container = container;
}
private ILifetimeScope CurrentScope
public class Global : HttpApplication
{
private static AppHost _appHost;
protected void Application_Start(object sender, EventArgs e)
{
_appHost = new AppHost();
_appHost.Init();
}
using System.Reflection;
using Autofac;
using Autofac.Core.Lifetime;
using Funq;
using Serilog;
using ServiceStack.Api.Postman;
using ServiceStack.Api.Swagger;
using ServiceStack.Logging;
using ServiceStack.Logging.Serilog;
using ServiceStack.ServiceInterface.Cors;
using System;
using Autofac;
using Funq;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
using ServiceStack.ServiceInterface;
using ServiceStack.Common;
using ServiceStack.ServiceInterface.Admin;
@alexeyzimarev
alexeyzimarev / elasticsearch-nest-geoquery-example.cs
Last active September 11, 2015 07:14 — forked from crunchie84/elasticsearch-nest-geoquery-example.cs
Easy example of indexing geo-based domain objects to ElasticSearch via #nest
using Nest;
using System;
using System.Globalization;
namespace elasticsearch_nest_geoindex_demo
{
public class Location
{
public string Name { get; set; }
source https://www.nuget.org/api/v2/
nuget Nuget.CommandLine
nuget AggregateSource 0.0.300 framework: >= net452
nuget AggregateSource.EventStore 0.0.300 framework: >= net452
nuget Autofac 3.5.2 framework: >= net452
nuget EventStore.Client 3.2.1 framework: >= net452
nuget EventStore.Client.Embedded 3.2.1 framework: >= net452
nuget EventStore.SerilogAdapter 1.0.0 framework: >= net452
nuget Ix-Main 1.2.5 framework: >= net452
public class Subscription
{
public Subscription(SubscriptionId id, int maxSubscriptions)
{
...
Dispatch(new SubscriptionCreated(..., maxSubscriptions));
}
...