Skip to content

Instantly share code, notes, and snippets.

View JordyLangen's full-sized avatar

Jordy Langen JordyLangen

  • Philips Hue, Signify
  • Netherlands
View GitHub Profile
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
"""
A `AlertManagementHttpIntegrationID` is a global ID. It is encoded as a string.
An example `AlertManagementHttpIntegrationID` is: `"gid://gitlab/AlertManagement::HttpIntegration/1"`.
"""
@JordyLangen
JordyLangen / signing-local-release.gradle
Last active February 22, 2016 13:15
Signing local release with debug keystore
signingConfigs {
release {
storeFile file("/home/jordy/.android/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
@JordyLangen
JordyLangen / AutoMapper Mapping inferfaces.cs
Last active February 22, 2016 13:18
3 classes and 1 method to resolve all automapper mappings through an interface
public interface IMapping
{
void ConfigureMapping();
}
public abstract class OneWayMapping<TSource, TDestination> : IMapping
{
public void ConfigureMapping()
{
Configure(Mapper.CreateMap<TSource, TDestination>());
@JordyLangen
JordyLangen / ICachedUnitOfWork.cs
Last active February 22, 2016 13:17
ICachedUnitOfWork implementation that caches query results
public interface ICachedUnitOfWork : IUnitOfWork
{
/// <summary>
/// Executes the specified Query or return a cached result.
/// </summary>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="query">The query.</param>
/// <returns></returns>
TResult Query<TEntity, TResult>(Expression<Func<IQueryable<TEntity>, TResult>> query) where TEntity : class;
@JordyLangen
JordyLangen / IUnitOfWork.cs
Last active March 21, 2018 05:18
Simple IUnitOfWork for Entity Framework implementation without using repositories.
public interface IUnitOfWork : IDisposable
{
/// <summary>
/// Gets this instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
IQueryable<T> All<T>() where T : class;
/// <summary>