This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ServiceCollectionExtensions | |
{ | |
public static void RegisterAllTypes<T>(this IServiceCollection services, Assembly[] assemblies, | |
ServiceLifetime lifetime = ServiceLifetime.Transient) | |
{ | |
var typesFromAssemblies = assemblies.SelectMany(a => a.DefinedTypes.Where(x => x.GetInterfaces().Contains(typeof(T)))); | |
foreach (var type in typesFromAssemblies) | |
services.Add(new ServiceDescriptor(typeof(T), type, lifetime)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Common; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore.Diagnostics; | |
namespace efcore_tenancy.Infrastructure | |
{ | |
public class SchemaInterceptor : DbCommandInterceptor | |
{ | |
private readonly TenantInfo tenantInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function dataCyLoader(source) { | |
var dataAttr= 'data-cy=\"([^"]*)\"'; | |
if(source.match(dataAttr)){ | |
source = source.replace(new RegExp(dataAttr, 'g'), ''); | |
} | |
return source; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
</PropertyGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleToWeb | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); // => This needs to be converted into a web app | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FuncR; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace Your.First.Function | |
{ | |
// We don't need no, implementation | |
public interface IFooService | |
{ | |
string Foo(int numberOfFoos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyDbContext : MyContext | |
{ | |
private readonly string connectionString; | |
public MyDbContext(string connectionString) : base() | |
{ | |
this.connectionString = connectionString; | |
} | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
namespace MyApp | |
{ | |
public class LoggerProxy : DispatchProxy | |
{ | |
private object remote; | |
public LoggerProxy SetRemoteObject(object remote) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Auth; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TableStoragePlugin | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using System.Data.Common; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Prise.Plugin; | |
namespace TableStoragePlugin | |
{ | |
[PluginBootstrapper(PluginType = typeof(TableStorageProductsRepository))] |
NewerOlder