Skip to content

Instantly share code, notes, and snippets.

View FransBouma's full-sized avatar

Frans Bouma FransBouma

View GitHub Profile
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 14">
@FransBouma
FransBouma / gist:8403b388aa30d3207be2
Last active August 29, 2015 14:08
How in-memory .net calls are in-lined in the final query in LLBLGen Pro's linq provider
var q = ctx.Customers.Select(c=>new Customer() { CompName = SomeMethod(c.CompanyName)});
-> visit the select lambda, and convert it so it becomes:
(values, indices) => new Customer() { CompName = SomeMethod(values[indices[0]])};
then compile the lambda. At projection time, execute the lambda with the object[] obtained from the datareader as 'values'
and a set of indices, one for each db value placed in the project. This way you can have any in-memory call in the projection
@FransBouma
FransBouma / gist:25ca8404add6fa145cce
Last active December 19, 2016 09:16
My email conversation with a certain MS employee regarding WPF

I'm not going to disagree with your comments on WinForms/WPF or current limitations for WinRT. Let me focus on WinForms/WPF for a minute...

First, I'm curious if your client application needs to support Windows 7? If so, the choice is clear for a Windows platform, WPF. If is the technology that is alive and staffed by the same team building future investments into the Windows client platform.

I was a bit surprised to read this. I do recall this: http://www.zdnet.com/blog/microsoft/microsoft-splits-up-its-xaml-team-whats-the-fallout/9807 which suggests there are multiple teams doing something with xaml, but I learn from your email that this isn't the case?

@FransBouma
FransBouma / enbeffectprepass.fx
Created March 23, 2015 12:06
enbeffectprepass.fx with desaturation
//////////////////////////////////////////////////////////////////////////
// //
// ENBSeries effect file //
// visit http://enbdev.com for updates //
// Copyright (c) 2007- Boris Vorontsov //
// //
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// //
// enbeffectprepass.fx depth of field by kingeric1992, //
// based on GDC 2004 presentation: //
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
@FransBouma
FransBouma / C#
Created July 21, 2015 08:49
.NET 4.6 breaking change?
internal static MethodInfo QueryableAllPredicate = GetQueryableMethodInfo(typeof(Queryable), "All",
(TSource) => new[]
{
typeof(IQueryable<>).MakeGenericType(TSource),
typeof(System.Linq.Expressions.Expression<>).MakeGenericType(typeof(Func<,>).MakeGenericType(TSource, typeof(bool)))
});
private static MethodInfo GetQueryableMethodInfo(Type declaringType, string methodName, Func<Type, Type[]> parameterTypeFactory)
{
return GetQueryableMethodInfo(declaringType, methodName, parameterTypeFactory.Method);
@FransBouma
FransBouma / OrderDetailDoc.cs
Last active August 26, 2015 14:09
Generated class from Derived Element (element derived from entity graph / entity sub model, denormalized). LLBLGen Pro v5. Attributes re added using rules (so defined once)
//------------------------------------------------------------------------------
// <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;
using System.ComponentModel.DataAnnotations;
@FransBouma
FransBouma / OrderCustomerMtoMQueries.cs
Created September 10, 2015 10:32
Auto-generated Linq queries from derived model definition on entity model.
//------------------------------------------------------------------------------
// <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;
using Dtos.DtoClasses;
using Northwind.Adapter.Linq;
using SD.LLBLGen.Pro.ORMSupportClasses;
@FransBouma
FransBouma / BoardmemberQueries.cs
Created September 14, 2015 15:50
Generate complex linq queries to project graph of inheritance using entities to DTO object graph
//------------------------------------------------------------------------------
// <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;
using InheritanceOneReverseEngineering.Linq;
using SD.LLBLGen.Pro.ORMSupportClasses;
@FransBouma
FransBouma / LinqQuery.cs
Created September 16, 2015 11:21
Linq Query that EF doesn't like: DbUnionAllExpression requires arguments with compatible collection ResultTypes. No way to tell it to do the proper projections in memory and just fetch the data! LLBLGen Pro handles it just fine.
return baseQuery.Select(p__0 => new DTOs.DtoClasses.BoardMemberDTO()
{
CompanyCar = new DTOs.DtoClasses.BoardMemberDTOTypes.CompanyCarDTO()
{
Brand = p__0.CompanyCar.Brand,
CarId = p__0.CompanyCar.CarId,
},
CompanyCarId = p__0.CompanyCar.CarId,
EmployeeId = p__0.EmployeeId,
ManagesDepartmentId = p__0.ManagesDepartment.DepartmentId,