Skip to content

Instantly share code, notes, and snippets.

View MatteoPiovanelli-Laser's full-sized avatar

Matteo Piovanelli MatteoPiovanelli-Laser

View GitHub Profile
@MatteoPiovanelli-Laser
MatteoPiovanelli-Laser / AutoroutePartHandler.cs
Created April 19, 2018 08:00
AutoroutePartHandler using ILockingProvider to reduce the chance of deadlock, while keeping DisplayAlias values unique for published content
using System;
using Orchard.Autoroute.Models;
using Orchard.Autoroute.Services;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Data;
using Orchard.Localization;
using Orchard.Locking;
using Orchard.UI.Notify;
@MatteoPiovanelli-Laser
MatteoPiovanelli-Laser / DefaultAuthCookieManager.cs
Last active January 16, 2018 11:24
draft of idea to enable better auth cookie management in orchard cms
public class DefaultAuthCookieManager : IAuthCookieManager {
private const int _cookieVersion = 3;
private readonly ShellSettings _settings;
private readonly IClock _clock;
private readonly IMembershipService _membershipService;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ISslSettingsProvider _sslSettingsProvider;
private readonly IMembershipValidationService _membershipValidationService;
using Nwazet.Commerce.Models;
using Orchard.ContentManagement.MetaData;
using Orchard.Data;
using Orchard.Data.Migration;
using Orchard.Environment.Extensions;
using System;
using System.Data;
namespace Nwazet.Commerce.Migrations {
[OrchardFeature("Nwazet.BaseTaxImplementations")]
@MatteoPiovanelli-Laser
MatteoPiovanelli-Laser / GasScore.txt
Last active January 16, 2018 13:10
Tracciamo a che ora arriva Gas a pranzo, e chi indovina
Piovanelli 2
Rapegno 1
Giulietti 1
Roletto 0
Di Perna 0
Antonioli 0
Lettieri 0
Comm_1 0
Comm_2 0
namespace Nwazet.Commerce.Models {
[OrchardFeature("Nwazet.Territories")]
public class TerritoryInternal {
public virtual int Id { get; set; } //Primary Key
public virtual string GUID {get; set; } //probably going to need this for import/export
public virtual IEnumerable<TerritoryInternal> ParentTerritories { get; set; }
public virtual IEnumerable<TerritoryInternal> ChildTerritories { get; set; }
}
}
@MatteoPiovanelli-Laser
MatteoPiovanelli-Laser / ShapePlacementParsingStrategy.cs
Last active August 30, 2017 17:43
ShapePlacementParsingStrategy.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.Environment.Descriptor.Models;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {