Click here to Skip to main content
15,885,914 members
Articles / Programming Languages / C#

Black Art – LINQ expressions reuse

Rate me:
Please Sign up or sign in to vote.
4.94/5 (16 votes)
2 Apr 2017CDDL8 min read 61.5K   312   39  
When developing a complex line of business system queries, reuse is often required. This article provides some guidelines and tools for LINQ expressions reuse.

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExpressionProjection", "LinqExpressionProjection\LinqExpressionProjection.csproj", "{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExpressionProjection.Test", "LinqExpressionProjection.Test\LinqExpressionProjection.Test.csproj", "{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExpressionsReuse", "LinqExpressionsReuse\LinqExpressionsReuse.csproj", "{1E3824FB-0A63-4D4F-91FA-649CCEF63159}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|Mixed Platforms = Debug|Mixed Platforms
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|Mixed Platforms = Release|Mixed Platforms
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Debug|x86.ActiveCfg = Debug|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Release|Any CPU.Build.0 = Release|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{DD149C86-76EE-40EF-80F0-4055EE0AD8B7}.Release|x86.ActiveCfg = Release|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Debug|x86.ActiveCfg = Debug|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Release|Any CPU.Build.0 = Release|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{C8FC2631-8BB0-4BEA-AB92-1D3A618D98B3}.Release|x86.ActiveCfg = Release|Any CPU
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Debug|Any CPU.ActiveCfg = Debug|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Debug|Mixed Platforms.Build.0 = Debug|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Debug|x86.ActiveCfg = Debug|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Debug|x86.Build.0 = Debug|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Release|Any CPU.ActiveCfg = Release|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Release|Mixed Platforms.ActiveCfg = Release|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Release|Mixed Platforms.Build.0 = Release|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Release|x86.ActiveCfg = Release|x86
		{1E3824FB-0A63-4D4F-91FA-649CCEF63159}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Chief Technology Officer Ziv systems, Israel
Israel Israel
Starting with Apple IIe BASICA, and working my way through Pascal, Power Builder, Visual basic (and the light office VBA) C, C++, I am now a full stack developer and development manager. Mostly with MS technologies on the server side and javascript(typescript) frameworks on the client side.

Comments and Discussions