This file contains hidden or 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.Linq; | |
using System.Linq.Expressions; | |
namespace Logic.Movies | |
{ | |
internal sealed class IdentitySpecification<T> : Specification<T> | |
{ | |
public override Expression<Func<T, bool>> ToExpression() | |
{ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
This file contains hidden or 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
https://www.thereformedprogrammer.net/six-things-i-learnt-about-using-asp-net-cores-razor-pages/ | |
https://www.thereformedprogrammer.net/asp-net-core-razor-pages-how-to-implement-ajax-requests/#filter-cshtml-cs | |
https://dzone.com/articles/creating-an-spa-using-razor-pages-with-blazor |
This file contains hidden or 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
// Routing setup | |
.config(function ($routeProvider) { | |
$routeProvider | |
.when('/home', { | |
controller: 'homeCtrl', | |
templateUrl: 'home.tpl.html' | |
}).when('/users', { | |
controller: 'usersCtrl', | |
controllerAs: 'vm', | |
templateUrl: 'users.tpl.html', |
This file contains hidden or 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
<script> | |
angular.module('config', []); | |
angular.module('myApp', ['config']); | |
window.onload = function(){ | |
// get injector object | |
var initInjector = angular.injector(['ng']); | |
// extract necessary angular services | |
var $http = initInjector.get('$http'); | |
var $timeout = initInjector.get('$timeout'); |
This file contains hidden or 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 AsyncMediatorPipeline<TRequest, TResponse> : IAsyncRequestHandler<TRequest, TResponse> where TRequest : IAsyncRequest<TResponse> | |
{ | |
private readonly IAsyncRequestHandler<TRequest, TResponse> inner; | |
private readonly IAsyncPreRequestHandler<TRequest>[] preRequestHandlers; | |
private readonly IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers; | |
public AsyncMediatorPipeline(IAsyncRequestHandler<TRequest, TResponse> inner, IAsyncPreRequestHandler<TRequest>[] preRequestHandlers, IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers) | |
{ | |
this.inner = inner; |
This file contains hidden or 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 MediatRInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) { | |
container.Register(Classes.FromAssemblyContaining<IMediator>().Pick().WithServiceAllInterfaces()); | |
container.Kernel.AddHandlersFilter(new ContravariantFilter()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IRequestHandler<,>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IPreRequestHandler<>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IPostRequestHandler<,>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (INotificationHandler<>)).WithService.AllInterfaces().LifestyleTransient()); |
This file contains hidden or 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
'use strict'; | |
app.factory('signalRHubProxy', ['$rootScope', 'signalRServer', | |
function ($rootScope, signalRServer) { | |
function signalRHubProxyFactory(serverUrl, hubName, startOptions) { | |
var connection = $.hubConnection(signalRServer); | |
var proxy = connection.createHubProxy(hubName); | |
connection.start(startOptions).done(function () { }); | |
return { |
This file contains hidden or 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
//Create the interface | |
interface ICustomPrincipal : IPrincipal | |
{ | |
int Id { get; set; } | |
string FirstName { get; set; } | |
string LastName { get; set; } | |
} | |
//CustomPrincipal | |
public class CustomPrincipal : ICustomPrincipal | |
{ |
This file contains hidden or 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
/** | |
* | |
* Simple jQuery Script to parse credit card data | |
* that was collected via a USB Magnetic Stripe | |
* Credit Card Reader. | |
* | |
* To get this to work, focus your cursor (either | |
* programmatically or via a click, it's your choice) on an input field #credit-card-number | |
* and then with the card reader plugged in, swipe | |
* the card and it will take over from there |