Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sfmskywalker on github.
  • I am sipke (https://keybase.io/sipke) on keybase.
  • I have a public key ASDL-AI4LIQ7bBa2xip4w9myhW1oXRfEDl_EgQ5aWQozTgo

To claim this, I am signing this object:

[Register(nameof(UILabeledPickerView))]
public class UILabeledPickerView : UIPickerView
{
public UILabeledPickerView(IntPtr handle) : base(handle)
{
}
private IDictionary<int, string> mLabelsDictionary = new Dictionary<int, string>();
@sfmskywalker
sfmskywalker / Startup.cs
Last active June 25, 2018 16:39
Root Startup file
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace MultiTenantApp
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
@sfmskywalker
sfmskywalker / tenants.json
Last active June 27, 2018 10:58
Sample tenants.json
{
"CustomerA": {
"State": "Running",
"RequestUrlHost": null,
"RequestUrlPrefix": "customer-a",
"CustomSetting": "Custom setting for Customer A",
"Features": [ "RemoteIp" ]
},
"CustomerB": {
"State": "Running",
using System.Threading.Tasks;
namespace MultiTenantApp
{
public interface IMessageProvider
{
Task<string> GetMessageAsync();
}
}
@sfmskywalker
sfmskywalker / Startup.cs
Created June 25, 2018 16:45
Startup class for the TimeOfDay feature
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
[assembly: OrchardCore.Modules.Manifest.Feature(
Id = "TimeOfDay",
Name = "TimeOfDay"
)]
namespace MultiTenantApp.Features.TimeOfDay
{
using System.Threading.Tasks;
using OrchardCore.Modules;
namespace MultiTenantApp.Features.TimeOfDay
{
public class TimeOfDayMessageProvider : IMessageProvider
{
private readonly IClock _clock;
public TimeOfDayMessageProvider(IClock clock)
@sfmskywalker
sfmskywalker / Startup.cs
Created June 25, 2018 16:49
The Startup class for the RemoteIp feature
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
[assembly: OrchardCore.Modules.Manifest.Feature(
Id = "RemoteIp",
Name = "RemoteIp"
)]
namespace MultiTenantApp.Features.RemoteIp
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace MultiTenantApp.Features.RemoteIp
{
public class RemoteIpMessageProvider : IMessageProvider
{
private readonly IHttpContextAccessor _httpContextAccessor;
public RemoteIpMessageProvider(IHttpContextAccessor httpContextAccessor)
@sfmskywalker
sfmskywalker / Startup.cs
Created June 25, 2018 16:54
Complete Startup class
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace MultiTenantApp
{
public class Startup