Skip to content

Instantly share code, notes, and snippets.

@lbehm
lbehm / STRING_AGG.cs
Last active May 16, 2023 14:16 — forked from FilipDeVos/Aggregate_Concatenate.sql
SQL Server Aggregate to concatenate strings - shim for STRING_AGG
using System;
using System.Data.SqlTypes;
using System.IO;
using System.Text;
using Microsoft.SqlServer.Server;
[Serializable]
[SqlUserDefinedAggregate(
Format.UserDefined,
IsInvariantToNulls = true,
@jorgenpt
jorgenpt / TextProgressBar.cs
Last active April 2, 2020 03:27
Text based progress bar for C#
using System;
using System.Collections.Generic;
namespace JPT
{
public class TextProgressBar : IDisposable
{
private int _progress;
private int _total;
private int _width;
@danielok
danielok / gist:9271691
Created February 28, 2014 14:07
Configuring AutoFac with ASP.NET MVC 5 Identity UserManager, ApplicationUser, UserStore
var builder = new ContainerBuilder();
builder.RegisterControllers(typeof(MvcApplication).Assembly);
builder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly)
.AsImplementedInterfaces();
builder.RegisterModule(new AutofacWebTypesModule());
builder.RegisterType<ApplicationDbContext>().InstancePerHttpRequest();
builder.RegisterType<UserStore<ApplicationUser>>().As<IUserStore<ApplicationUser>>();