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
import { Injectable } from "@angular/core"; | |
import { Router } from "@angular/router"; | |
import { JwtHelperService } from '@auth0/angular-jwt'; | |
import { BehaviorSubject, from, Observable, of } from "rxjs"; | |
import { distinctUntilChanged, take, tap } from "rxjs/operators"; | |
import { RoleConsts } from "src/app/_core/security/roles-consts"; | |
import { CurrentUserService } from "src/app/_services/current-user/current-user.service"; | |
import { IUserProfile } from "src/app/_services/current-user/i.user.profile"; | |
import { environment } from 'src/environments/environment'; | |
import { AdalService } from "wfw-ngx-adal/dist/core"; |
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.Diagnostics; | |
using System.IO; | |
using System.Linq.Expressions; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace R | |
{ |
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
$(document).on('click', '[data-toggle="class"]', function () { | |
var $target = $($(this).data('target')); | |
var toggleClasses = $(this).data('toggle-classes'); | |
if (toggleClasses) | |
$target.toggleClass(toggleClasses); | |
var addClass = $(this).data('add-classes'); | |
if (addClass) | |
$target.addClass(addClass); |
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.Linq.Expressions; | |
/// <summary> | |
/// Usage: | |
/// var exp1 = (Expression<Func<Person, string>>) exp1 = i => i.Addresses[0].City; | |
/// var exp2 = (Expression<Func<Person, string>>) exp1 = j => j.Addresses[0].City; | |
/// var exp1String = new ExpressionInitialParameterRenamer().Rename(exp1).ToString(); | |
/// /// </summary> | |
namespace ExpressionHelper |
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.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Filters; | |
using Microsoft.AspNet.OData; | |
using Microsoft.AspNet.OData.Extensions; | |
using Microsoft.AspNet.OData.Query; | |
using System.Linq; | |
using System; | |
using Newtonsoft.Json; | |
namespace R.Web.Api |
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
import {NgControl} from "@angular/forms"; | |
import {Directive, ElementRef} from "@angular/core"; | |
@Directive({ | |
selector: '[ngModel]', // or 'input, select, textarea' - but then your controls won't be handled and also checking for undefined would be necessary | |
}) | |
export class NativeElementInjectorDirective { | |
constructor(private el: ElementRef, private control : NgControl) { | |
(<any>control.control).nativeElement = el.nativeElement; | |
} |
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
// | |
// COMMON DLL | |
// | |
public interface IStatusCode | |
{ | |
int? StatusCode { get; set; } | |
} | |
public static class IStatusCodeEx |
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 TransactionScope New(TransactionScopeOption transactionScopeOption = TransactionScopeOption.Required, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted, TimeSpan? timeout = null) | |
{ | |
// NOTE: this is a fix, to avoid inner transaction timeout's to shorten the outer one... | |
if (Transaction.Current != null && transactionScopeOption == TransactionScopeOption.Required) | |
timeout = TimeSpan.FromMinutes(15); | |
var options = new TransactionOptions | |
{ | |
IsolationLevel = isolationLevel, | |
Timeout = timeout ?? TransactionManager.DefaultTimeout |
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
/// <summary> | |
/// Depends on domain events... | |
/// Reason: wanted to de-couple it from the next job and so I do have DI objects accessible... | |
/// | |
/// NOTE: | |
/// This is by default a PERMANENT failure notification filter, since the filter Order is so high, it get's surely executed after the AutomaticRetry filter. | |
/// Also if AutomaticRetry filter does delete the job on permanent fail, the PERMANENT failure notification won't occure. | |
/// | |
/// If the HangfirePermanentFailureNotificationEvent.Order is less than the AutomaticRetry.Order, we will get a notification on each failure, not just the last one! | |
/// </summary> |
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
/// <summary> | |
/// Usage: [JsonConverter(typeof(JsonDateTimeConverter), "MM\\/dd\\/yyyy")]. | |
/// Dates created/set in JS had time-zones appended. By using string, this issue won't persist... | |
/// </summary> | |
public class JsonDateTimeConverter : DateTimeConverterBase | |
{ | |
private string CustomFormat { get; } | |
public JsonDateTimeConverter(string customFormat) | |
{ |
NewerOlder