Skip to content

Instantly share code, notes, and snippets.

View FransBouma's full-sized avatar

Frans Bouma FransBouma

View GitHub Profile
@FransBouma
FransBouma / gist:efc7b8b5e3e2b4577ee1
Created September 21, 2015 18:30
Nuget and restore
What I'm doing:
- I work on LLBLGen Pro, an entity modeling system
- I generate for an entity model two codebases: one with the entity classes (A) and one with code-first entity framework code (B).
- I generate csproj files with references to the files in the projects, one for A and one for B. A and B are in separate folders, the
csproj files are in the folders of the projects, just like when you'd create them manually.
- What I want now is that B, on build, pulls the entity framework v6 assembly from nuget.
What I have tried:
- I generate the packages.config file with proper xml which defines a reference to the EntityFramework package, v6.1.3, for net45.
- This packages.config file is added to the csproj file of B.
@FransBouma
FransBouma / Nuget issues
Last active October 7, 2015 13:29
Nuget mess
PM> install-package entityframework
'EntityFramework 6.1.3' already installed.
Adding 'EntityFramework 6.1.3' to Tests.
install-package : Failed to add reference to 'System.ComponentModel.DataAnnotations'. Please make sure that it is in the Global Assembly Cache.
At line:1 char:1
+ install-package entityframework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
@FransBouma
FransBouma / wip.cs
Last active October 7, 2015 13:54
EF to RavenDB with almost no work. Still have to tell RavenDB that the field with the Key attribute is the Id field, but that's minor.
[TestFixture]
public class SimpleTests
{
private IDocumentStore _store;
[TestFixtureSetUp]
public void Init()
{
InterceptorCore.Initialize("EF6");
@FransBouma
FransBouma / BoardMemberPersistence.cs
Last active October 13, 2015 10:57
Mongo C# inheritance in subtypes failure.
//------------------------------------------------------------------------------
// <auto-generated>This code was generated by LLBLGen Pro v5.0.</auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace IHMMDocs.MongoDB.Persistence
{
@FransBouma
FransBouma / Boardmember.cs
Last active October 14, 2015 12:33
Document setup for RethinkDB, fails to insert type info. How to configure it to do so? The 'Employees' collection contains the supertype, not the subtype 'Boardmember'. The test to check the result fails.
//------------------------------------------------------------------------------
// <auto-generated>This code was generated by LLBLGen Pro v5.0.</auto-generated>
//------------------------------------------------------------------------------
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.Collections.Specialized;
using System.Collections.Generic;
@FransBouma
FransBouma / McFX.cfg
Last active September 24, 2021 13:53
The Witcher 3 Reshade files. I've enabled FXAA and SMAA. FXAA is for when the freecam is active as the game's DoF is then disabled. In-game it's best to disable it by default and only use SMAA. Alo use the in-game AA for the vegetation. For Reshade 1.0. If you're using 1.1, copy the settings of the sections I enabled to the v1.1 config files.
////----------//
///**GLOBAL**///
//----------////
//-Global Defines-//
//>McFX Suite General Settings<\\
//-Commentary:The McFX Suite contains various Depth of Field, ambient occlusion and vision changing shader.\nThose shader are derived from MasterEffect.
@FransBouma
FransBouma / DepthHaze.h
Created November 15, 2015 10:19
Shader which crashes reshade compiler with compilation failed but no errors. Work in progress, so it will bug at runtime, if it gets compiled that is...
NAMESPACE_ENTER(OFX)
#include OFX_SETTINGS_DEF
#if USE_DEPTHHAZE
///////////////////////////////////////////////////////////////////
// Based on default old DoF. The old DoF was original programmed by:
// Matso, gp65cj042, MartyMcFly
//
// This effect works like a one-side DoF for distance haze, which slightly
@FransBouma
FransBouma / howtogetvsnetthemeid.cs
Created January 21, 2016 16:33
How to get the theme ID inside a vs.net extension without using references to vsnet2012 dlls (so code can be added to 2010 vsix too)
var themeService = this.ActiveServiceProvider.GetService(new Guid("0D915B59-2ED7-472A-9DE8-9161737EA1C5"));
if(themeService == null)
{
// no theming, no problem!
return;
}
var currentThemeProperty = themeService.GetType().GetProperty("CurrentTheme");
if(currentThemeProperty == null)
{
// something's wrong. No theming for you
@FransBouma
FransBouma / DepthHaze.h
Created March 1, 2016 18:20
DepthHaze with fog
NAMESPACE_ENTER(OFX)
#include OFX_SETTINGS_DEF
#if USE_DEPTHHAZE
///////////////////////////////////////////////////////////////////
// This effect works like a one-side DoF for distance haze, which slightly
// blurs far away elements. A normal DoF has a focus point and blurs using
// two planes.
//
[Test]
public void SingleOnWhereOnGetQueryable()
{
using(var adapter = new DataAccessAdapter())
{
var metaData = new LinqMetaData(adapter);
var r = metaData.GetQueryableForEntity<CustomerEntity>().Where(c=>c.CustomerId == "ALFKI").Single();
Assert.AreEqual("ALFKI", r.CustomerId);
}