Skip to content

Instantly share code, notes, and snippets.

Andrew Lock andrewlock

Block or report user

Report or block andrewlock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andrewlock
andrewlock / UserService.cs
Created Sep 14, 2016
Getting a Task when you don't expect it
View UserService.cs
public class UserService
{
private readonly IUserRepo _repo;
public UserService(IUserRepo repo)
{
_repo = repo;
}
public async Task<bool> DoesUserExist(int userId)
@andrewlock
andrewlock / startup.cs
Last active Aug 4, 2016
Creating DbContext ConfigureServices
View startup.cs
public void ConfigureServices(IServiceCollection services)
{
var connectionString = Configuration["ApplicationDbContext:ConnectionString"];
services.AddDbContext<ApplicationDbContext>(
opts => opts.UseNpgsql(connectionString)
);
services.Configure<MultitenancyOptions>(
options =>
{
You can’t perform that action at this time.