From 19f1827f9b04d432b68cbf79ac136ccf4325228d Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Wed, 1 Aug 2012 01:05:32 +0200 Subject: [PATCH 01/87] port to .NET 4.0 --- 3rdParties/NUnit/nunit-console-x86.exe.config | 3 +++ 3rdParties/NUnit/nunit-console.exe.config | 3 +++ Code/Epic.Core/Epic.Core.csproj | 13 ++++++------- Code/Epic.Prelude/Epic.Prelude.csproj | 3 +-- Code/Epic.Query.Linq/Epic.Query.Linq.csproj | 13 ++++++------- Code/Epic.Query.Linq/Reflection.cs | 11 +++++++++++ Code/Epic.Query.Object/Epic.Query.Object.csproj | 13 ++++++------- Code/Epic.Query/Epic.Query.csproj | 13 ++++++------- Code/Epic.nunit | 2 +- Code/Epic.sln | 4 ++-- .../Epic.Core.UnitTests/Epic.Core.UnitTests.csproj | 13 ++++++------- .../Epic.Prelude.UnitTests.csproj | 3 +-- .../Epic.Query.Linq.UnitTests.csproj | 13 ++++++------- .../Epic.Query.Linq.UnitTests/ReflectionQA.cs | 2 +- .../Epic.Query.Object.UnitTests.csproj | 13 ++++++------- .../Epic.Query.UnitTests.csproj | 13 ++++++------- Tools/NantScripts/Properties.include | 4 ++-- 17 files changed, 73 insertions(+), 66 deletions(-) diff --git a/3rdParties/NUnit/nunit-console-x86.exe.config b/3rdParties/NUnit/nunit-console-x86.exe.config index fa0a2621..06c058ff 100644 --- a/3rdParties/NUnit/nunit-console-x86.exe.config +++ b/3rdParties/NUnit/nunit-console-x86.exe.config @@ -1,5 +1,8 @@ + + + diff --git a/3rdParties/NUnit/nunit-console.exe.config b/3rdParties/NUnit/nunit-console.exe.config index fa0a2621..06c058ff 100644 --- a/3rdParties/NUnit/nunit-console.exe.config +++ b/3rdParties/NUnit/nunit-console.exe.config @@ -1,5 +1,8 @@ + + + diff --git a/Code/Epic.Core/Epic.Core.csproj b/Code/Epic.Core/Epic.Core.csproj index 99d784d7..62c30d3a 100644 --- a/Code/Epic.Core/Epic.Core.csproj +++ b/Code/Epic.Core/Epic.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic Epic.Core - v3.5 - true + True full - false + False ..\..\build\bin\Debug DEBUG prompt 4 - false + False none - false + False ..\..\build\bin\Release prompt 4 - false + False diff --git a/Code/Epic.Prelude/Epic.Prelude.csproj b/Code/Epic.Prelude/Epic.Prelude.csproj index e21ae9f6..705a9980 100644 --- a/Code/Epic.Prelude/Epic.Prelude.csproj +++ b/Code/Epic.Prelude/Epic.Prelude.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,7 +9,6 @@ Library Epic.Prelude Epic - v3.5 True diff --git a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj index d93812e7..3fe893cc 100644 --- a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj +++ b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic.Query.Linq Epic.Query.Linq - v3.5 - true + True full - false + False ..\..\build\bin\Debug DEBUG prompt 4 - false + False none - false + False ..\..\build\bin\Release prompt 4 - false + False diff --git a/Code/Epic.Query.Linq/Reflection.cs b/Code/Epic.Query.Linq/Reflection.cs index 45f48605..19452c50 100644 --- a/Code/Epic.Query.Linq/Reflection.cs +++ b/Code/Epic.Query.Linq/Reflection.cs @@ -684,6 +684,12 @@ static Queryable() GetGenericMethodInfoFromExpressionBody(() => q.Where((i, p) => true)), GetGenericMethodInfoFromExpressionBody(() => e.Where((i, p) => true)) ); + + AddTranslation( + GetGenericMethodInfoFromExpressionBody(() => q.Zip(dummyEnumerable, (i, p) => true)), + GetGenericMethodInfoFromExpressionBody(() => e.Zip(dummyEnumerable, (i, p) => true)) + ); + } /// @@ -1446,6 +1452,11 @@ static Enumerable() GetGenericMethodInfoFromExpressionBody(() => e.Where((i, p) => true)), GetGenericMethodInfoFromExpressionBody(() => q.Where((i, p) => true)) ); + + AddTranslation( + GetGenericMethodInfoFromExpressionBody(() => e.Zip(dummyEnumerable, (i, p) => true)), + GetGenericMethodInfoFromExpressionBody(() => q.Zip(dummyEnumerable, (i, p) => true)) + ); } /// diff --git a/Code/Epic.Query.Object/Epic.Query.Object.csproj b/Code/Epic.Query.Object/Epic.Query.Object.csproj index a150c0b2..1fec3a16 100644 --- a/Code/Epic.Query.Object/Epic.Query.Object.csproj +++ b/Code/Epic.Query.Object/Epic.Query.Object.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic.Query.Object Epic.Query.Object - v3.5 - true + True full - false + False ..\..\build\bin\Debug DEBUG; prompt 4 - false + False none - true + True ..\..\build\bin\Release prompt 4 - false + False diff --git a/Code/Epic.Query/Epic.Query.csproj b/Code/Epic.Query/Epic.Query.csproj index 87b75e1a..d8f0df9f 100644 --- a/Code/Epic.Query/Epic.Query.csproj +++ b/Code/Epic.Query/Epic.Query.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -8,25 +8,24 @@ {45E26C2D-47BD-42D7-8326-CE92777D79A4} Library Epic.Query - v3.5 - true + True full - false + False ..\..\build\bin\Debug DEBUG; prompt 4 - false + False none - true + True ..\..\build\bin\Release prompt 4 - false + False diff --git a/Code/Epic.nunit b/Code/Epic.nunit index 0b84f515..aac7f1f6 100644 --- a/Code/Epic.nunit +++ b/Code/Epic.nunit @@ -1,6 +1,6 @@  - + diff --git a/Code/Epic.sln b/Code/Epic.sln index 1227e01f..131bd82c 100644 --- a/Code/Epic.sln +++ b/Code/Epic.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Epic.Core", "Epic.Core\Epic.Core.csproj", "{A7F7A6D3-943F-480D-ADF2-7E846DD62D8C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{A9C8E0D7-C788-472B-A673-CA58D5F15B1A}" diff --git a/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj b/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj index d8fd8e7f..2d7ada82 100644 --- a/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj +++ b/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic Epic.Core.UnitTests - v3.5 - true + True full - false + False ..\..\..\build\tests\Debug DEBUG prompt 4 - false + False none - false + False ..\..\..\build\tests\Release prompt 4 - false + False diff --git a/Code/UnitTests/Epic.Prelude.UnitTests/Epic.Prelude.UnitTests.csproj b/Code/UnitTests/Epic.Prelude.UnitTests/Epic.Prelude.UnitTests.csproj index be3a0439..179beaff 100644 --- a/Code/UnitTests/Epic.Prelude.UnitTests/Epic.Prelude.UnitTests.csproj +++ b/Code/UnitTests/Epic.Prelude.UnitTests/Epic.Prelude.UnitTests.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -8,7 +8,6 @@ {E8A2F061-A13F-4F97-AB03-7856D86A3D8B} Library Epic.Prelude.UnitTests - v3.5 Epic diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj b/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj index 71fd9700..f3ed9fab 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic.Query.Linq Epic.Query.Linq.UnitTests - v3.5 - true + True full - false + False ..\..\..\build\tests\Debug DEBUG prompt 4 - false + False none - false + False ..\..\..\build\tests\Release prompt 4 - false + False diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs index eb82ab09..7ec955cf 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs @@ -69,7 +69,7 @@ static ReflectionQA() public void VerifyKnownMethods() { Assert.AreEqual(14, ReflectionQA.AllEnumerableMethodsThatHaveNoEquivalentInQueryable.Count()); - Assert.AreEqual(160, ReflectionQA.AllEnumerableMethodsThatHaveEquivalentInQueryable.Count()); + Assert.AreEqual(161, ReflectionQA.AllEnumerableMethodsThatHaveEquivalentInQueryable.Count()); Assert.AreEqual(110, ReflectionQA.QueryableEnumerableEquivantMethods.Count()); } diff --git a/Code/UnitTests/Epic.Query.Object.UnitTests/Epic.Query.Object.UnitTests.csproj b/Code/UnitTests/Epic.Query.Object.UnitTests/Epic.Query.Object.UnitTests.csproj index 16580271..c20b46b8 100644 --- a/Code/UnitTests/Epic.Query.Object.UnitTests/Epic.Query.Object.UnitTests.csproj +++ b/Code/UnitTests/Epic.Query.Object.UnitTests/Epic.Query.Object.UnitTests.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,25 +9,24 @@ Library Epic.Query.Object.UnitTests Epic.Query.Object.UnitTests - v3.5 - true + True full - false + False ..\..\..\build\tests\Debug DEBUG; prompt 4 - false + False none - true + True ..\..\..\build\tests\Release prompt 4 - false + False diff --git a/Code/UnitTests/Epic.Query.UnitTests/Epic.Query.UnitTests.csproj b/Code/UnitTests/Epic.Query.UnitTests/Epic.Query.UnitTests.csproj index 4df11701..44ee0947 100644 --- a/Code/UnitTests/Epic.Query.UnitTests/Epic.Query.UnitTests.csproj +++ b/Code/UnitTests/Epic.Query.UnitTests/Epic.Query.UnitTests.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -8,26 +8,25 @@ {148CECBF-1B45-48FF-9F15-4E5CB52EDEFD} Library Epic.Query.UnitTests - v3.5 Epic.Query - true + True full - false + False ..\..\..\build\tests\Debug DEBUG; prompt 4 - false + False none - true + True ..\..\..\build\tests\Release prompt 4 - false + False diff --git a/Tools/NantScripts/Properties.include b/Tools/NantScripts/Properties.include index 2a19dbd5..33d7fee3 100644 --- a/Tools/NantScripts/Properties.include +++ b/Tools/NantScripts/Properties.include @@ -3,8 +3,8 @@ - - + + From acce77a6e079c5a3e53d5dd332082844c9c577b9 Mon Sep 17 00:00:00 2001 From: Bards Release Manager Date: Wed, 1 Aug 2012 18:32:41 +0200 Subject: [PATCH 02/87] added environment variables to profile nunit in 4.0 with ncover 1.5.8 to RunNUnit.include --- Tools/NantScripts/Properties.include | 1 - Tools/NantScripts/RunNUnit.include | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Tools/NantScripts/Properties.include b/Tools/NantScripts/Properties.include index 33d7fee3..c79444c8 100644 --- a/Tools/NantScripts/Properties.include +++ b/Tools/NantScripts/Properties.include @@ -26,7 +26,6 @@ - diff --git a/Tools/NantScripts/RunNUnit.include b/Tools/NantScripts/RunNUnit.include index a7831af4..cf5f9774 100644 --- a/Tools/NantScripts/RunNUnit.include +++ b/Tools/NantScripts/RunNUnit.include @@ -11,6 +11,10 @@ + + + + @@ -25,6 +29,10 @@ + + + + From 99269e020d2c631edf9fe2f2b234237f9bc8d328 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 3 Aug 2012 01:40:31 +0200 Subject: [PATCH 03/87] fix build on mono with 4.0 profile --- Code/Epic.Core/Epic.Core.csproj | 4 +--- Code/Epic.Query.Linq/Epic.Query.Linq.csproj | 4 +--- Code/Epic.Query/Epic.Query.csproj | 4 +--- .../Epic.Core.UnitTests/Epic.Core.UnitTests.csproj | 8 +++++--- .../Epic.Query.Linq.UnitTests.csproj | 4 +--- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Code/Epic.Core/Epic.Core.csproj b/Code/Epic.Core/Epic.Core.csproj index 62c30d3a..e739d2e3 100644 --- a/Code/Epic.Core/Epic.Core.csproj +++ b/Code/Epic.Core/Epic.Core.csproj @@ -30,9 +30,7 @@ - - 3.5 - + diff --git a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj index 3fe893cc..b92157d7 100644 --- a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj +++ b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj @@ -30,9 +30,7 @@ - - 3.5 - + diff --git a/Code/Epic.Query/Epic.Query.csproj b/Code/Epic.Query/Epic.Query.csproj index d8f0df9f..a1f7a2b8 100644 --- a/Code/Epic.Query/Epic.Query.csproj +++ b/Code/Epic.Query/Epic.Query.csproj @@ -29,9 +29,7 @@ - - 3.5 - + diff --git a/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj b/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj index 2d7ada82..18fbfdbe 100644 --- a/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj +++ b/Code/UnitTests/Epic.Core.UnitTests/Epic.Core.UnitTests.csproj @@ -39,9 +39,7 @@ ..\..\..\build\bin\Debug\Challenge00.DDDSample.dll - - 3.5 - + @@ -75,5 +73,9 @@ {E8A2F061-A13F-4F97-AB03-7856D86A3D8B} Epic.Prelude.UnitTests + + {05F67FFC-37A0-4CDC-BC67-E32CBFBE22A7} + Epic.Prelude + \ No newline at end of file diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj b/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj index f3ed9fab..ed08bb32 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Epic.Query.Linq.UnitTests.csproj @@ -36,9 +36,7 @@ ..\..\..\3rdParties\Rhino.Mocks\Rhino.Mocks.dll - - 3.5 - + From f43fe622cc203579d5d29fefe4a833ce7fa38280 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 3 Aug 2012 18:43:53 +0200 Subject: [PATCH 04/87] initial configuration for API documentation --- .gitignore | 1 + Code/Epic.Core/Epic.Core.csproj | 6 +- Code/Epic.Prelude/Collections/IMap.cs | 2 + .../Collections/KeyNotFoundException.cs | 1 + Code/Epic.Prelude/CompositeVisitor.cs | 1 + Code/Epic.Prelude/CompositeVisitorBase.cs | 2 + Code/Epic.Prelude/Epic.Prelude.csproj | 4 + Code/Epic.Prelude/Specifications/Any.cs | 2 +- .../Specifications/Conjunction.cs | 7 +- .../Specifications/Disjunction.cs | 7 +- Code/Epic.Prelude/Specifications/Negation.cs | 4 + Code/Epic.Prelude/Specifications/OfType.cs | 6 ++ .../StatelessSpecificationBase.cs | 2 + Code/Epic.Query.Linq/Epic.Query.Linq.csproj | 4 + .../Epic.Query.Object.csproj | 4 + Code/Epic.Query/Epic.Query.csproj | 4 + Documentation/Epic.API.shfbproj | 95 +++++++++++++++++++ 17 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 Documentation/Epic.API.shfbproj diff --git a/.gitignore b/.gitignore index aaa965b8..e4e3cf1e 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ _ReSharper*/ #Subversion files .svn +Documentation/Epic.API.shfbproj_* diff --git a/Code/Epic.Core/Epic.Core.csproj b/Code/Epic.Core/Epic.Core.csproj index e739d2e3..e71f7909 100644 --- a/Code/Epic.Core/Epic.Core.csproj +++ b/Code/Epic.Core/Epic.Core.csproj @@ -19,6 +19,8 @@ prompt 4 False + True + ..\..\build\bin\Debug\Epic.Core.XML none @@ -27,10 +29,12 @@ prompt 4 False + True + ..\..\build\bin\Release\Epic.Core.XML - + diff --git a/Code/Epic.Prelude/Collections/IMap.cs b/Code/Epic.Prelude/Collections/IMap.cs index 0da0457c..ff78c486 100644 --- a/Code/Epic.Prelude/Collections/IMap.cs +++ b/Code/Epic.Prelude/Collections/IMap.cs @@ -29,6 +29,8 @@ namespace Epic.Collections /// A map that provide access to /// given a . /// + /// The type of keys in the map. + /// The type of values in the map. public interface IMap where TKey : IEquatable { diff --git a/Code/Epic.Prelude/Collections/KeyNotFoundException.cs b/Code/Epic.Prelude/Collections/KeyNotFoundException.cs index 1d8dfc6a..50c756e6 100644 --- a/Code/Epic.Prelude/Collections/KeyNotFoundException.cs +++ b/Code/Epic.Prelude/Collections/KeyNotFoundException.cs @@ -32,6 +32,7 @@ namespace Epic.Collections /// accessing an element in a does not match any /// key in the map. /// + /// The type of keys in the map. [Serializable] public sealed class KeyNotFoundException : KeyNotFoundException where TKey : IEquatable diff --git a/Code/Epic.Prelude/CompositeVisitor.cs b/Code/Epic.Prelude/CompositeVisitor.cs index 2eecfcb0..475cfe62 100644 --- a/Code/Epic.Prelude/CompositeVisitor.cs +++ b/Code/Epic.Prelude/CompositeVisitor.cs @@ -31,6 +31,7 @@ namespace Epic /// /// Visitors' composition. It uses composition to handle the visit of any type of expression tree. /// + /// Type of the result produced by the visit. /// public abstract class CompositeVisitor : IVisitor { diff --git a/Code/Epic.Prelude/CompositeVisitorBase.cs b/Code/Epic.Prelude/CompositeVisitorBase.cs index a3e8939d..f258451c 100644 --- a/Code/Epic.Prelude/CompositeVisitorBase.cs +++ b/Code/Epic.Prelude/CompositeVisitorBase.cs @@ -29,6 +29,8 @@ namespace Epic /// /// Visitors' composition base class. This class must be derived from concrete compositions. /// + /// The type of the result produced by the visit. + /// The type of the expression to visit. [DebuggerDisplay("CompositeVisitor<{typeof(TResult).Name, nq}, {typeof(TExpression).Name, nq}> {_name} ({_chain.Count} visitors)")] public abstract class CompositeVisitorBase : CompositeVisitor, IVisitor where TExpression : class diff --git a/Code/Epic.Prelude/Epic.Prelude.csproj b/Code/Epic.Prelude/Epic.Prelude.csproj index 705a9980..9035102b 100644 --- a/Code/Epic.Prelude/Epic.Prelude.csproj +++ b/Code/Epic.Prelude/Epic.Prelude.csproj @@ -19,6 +19,8 @@ prompt 4 False + True + ..\..\build\bin\Debug\Epic.Prelude.XML none @@ -27,6 +29,8 @@ prompt 4 False + True + ..\..\build\bin\Release\Epic.Prelude.XML diff --git a/Code/Epic.Prelude/Specifications/Any.cs b/Code/Epic.Prelude/Specifications/Any.cs index f8fed2fb..dac2e97d 100644 --- a/Code/Epic.Prelude/Specifications/Any.cs +++ b/Code/Epic.Prelude/Specifications/Any.cs @@ -30,7 +30,7 @@ namespace Epic.Specifications /// /// Specification that is satisfied by any . /// - /// Type of the objects that can be tested with this specification. + /// The type of the objects that can be tested with this specification. [Serializable] public sealed class Any : StatelessSpecificationBase, TCandidate>, IEquatable>, diff --git a/Code/Epic.Prelude/Specifications/Conjunction.cs b/Code/Epic.Prelude/Specifications/Conjunction.cs index 7638b0ad..245e724e 100644 --- a/Code/Epic.Prelude/Specifications/Conjunction.cs +++ b/Code/Epic.Prelude/Specifications/Conjunction.cs @@ -1,5 +1,5 @@ // -// And.cs +// Conjunction.cs // // Author: // Giacomo Tesio @@ -26,6 +26,11 @@ namespace Epic.Specifications { + /// + /// Specification that is satisfied by any that is satisfied by all the + /// specifications. + /// + /// The type of the objects that can be tested with this specification. [Serializable] public sealed class Conjunction : SpecificationBase, TCandidate>, IEquatable>, diff --git a/Code/Epic.Prelude/Specifications/Disjunction.cs b/Code/Epic.Prelude/Specifications/Disjunction.cs index 510165d6..310d6ecc 100644 --- a/Code/Epic.Prelude/Specifications/Disjunction.cs +++ b/Code/Epic.Prelude/Specifications/Disjunction.cs @@ -1,5 +1,5 @@ // -// Or.cs +// Disjunction.cs // // Author: // Giacomo Tesio @@ -26,6 +26,11 @@ namespace Epic.Specifications { + /// + /// Specification that is satisfied by any that is satisfied by at + /// least one of the specifications. + /// + /// The type of the objects that can be tested with this specification. [Serializable] public sealed class Disjunction : SpecificationBase, TCandidate>, IEquatable>, diff --git a/Code/Epic.Prelude/Specifications/Negation.cs b/Code/Epic.Prelude/Specifications/Negation.cs index 68610a69..32e627b5 100644 --- a/Code/Epic.Prelude/Specifications/Negation.cs +++ b/Code/Epic.Prelude/Specifications/Negation.cs @@ -25,6 +25,10 @@ namespace Epic.Specifications { + /// + /// Specification that is satisfied by any that doesn't satisfy the negated one. + /// + /// The type of the objects that can be tested with this specification. [Serializable] public sealed class Negation : SpecificationBase, TCandidate>, IEquatable> diff --git a/Code/Epic.Prelude/Specifications/OfType.cs b/Code/Epic.Prelude/Specifications/OfType.cs index 9603359b..f0878cb7 100644 --- a/Code/Epic.Prelude/Specifications/OfType.cs +++ b/Code/Epic.Prelude/Specifications/OfType.cs @@ -25,6 +25,12 @@ namespace Epic.Specifications { + /// + /// Specification that is satisfied by any that is a + /// satisfing the inner specification. + /// + /// Type of the objects that can be tested with this specification. + /// Type of the objects that can be tested with inner specification. [Serializable] public sealed class OfType : SpecificationBase, TCandidate>, IEquatable> diff --git a/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs b/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs index 1d83a8f9..7238b8d2 100644 --- a/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs +++ b/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs @@ -28,6 +28,8 @@ namespace Epic.Specifications /// /// Base class for stateless specification. /// + /// Type of the specification implemented. + /// Type of the candidates to satisfy the specification. [Serializable] public abstract class StatelessSpecificationBase : SpecificationBase where TCandidate : class diff --git a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj index b92157d7..554b8d55 100644 --- a/Code/Epic.Query.Linq/Epic.Query.Linq.csproj +++ b/Code/Epic.Query.Linq/Epic.Query.Linq.csproj @@ -19,6 +19,8 @@ prompt 4 False + True + ..\..\build\bin\Debug\Epic.Query.Linq.XML none @@ -27,6 +29,8 @@ prompt 4 False + True + ..\..\build\bin\Release\Epic.Query.Linq.XML diff --git a/Code/Epic.Query.Object/Epic.Query.Object.csproj b/Code/Epic.Query.Object/Epic.Query.Object.csproj index 1fec3a16..be08339f 100644 --- a/Code/Epic.Query.Object/Epic.Query.Object.csproj +++ b/Code/Epic.Query.Object/Epic.Query.Object.csproj @@ -19,6 +19,8 @@ prompt 4 False + True + ..\..\build\bin\Debug\Epic.Query.Object.XML none @@ -27,6 +29,8 @@ prompt 4 False + True + ..\..\build\bin\Release\Epic.Query.Object.XML diff --git a/Code/Epic.Query/Epic.Query.csproj b/Code/Epic.Query/Epic.Query.csproj index a1f7a2b8..ed4d916f 100644 --- a/Code/Epic.Query/Epic.Query.csproj +++ b/Code/Epic.Query/Epic.Query.csproj @@ -18,6 +18,8 @@ prompt 4 False + True + ..\..\build\bin\Debug\Epic.Query.XML none @@ -26,6 +28,8 @@ prompt 4 False + True + ..\..\build\bin\Release\Epic.Query.XML diff --git a/Documentation/Epic.API.shfbproj b/Documentation/Epic.API.shfbproj new file mode 100644 index 00000000..43bbb400 --- /dev/null +++ b/Documentation/Epic.API.shfbproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + 2.0 + {4064220d-1c73-4463-b6f5-29869ddec88b} + 1.9.3.0 + + Documentation + Documentation + Documentation + + ..\build\doc\ + Documentation + en-US + MemberName + True + vs2005 + CSharp + Website + True + Copyright %28c%29 2010-2012 Giacomo Tesio + mailto:giacomo%40tesio.it + Epic.NET + Attributes, InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected, SealedProtected + Epic is an open source framework designed to keep your domain model implementation fully focused on the enterprise business targeted by the application, with an infrastructure ignorant fashion.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b +It achieves a new kind of dependency inversion, where the domain model settles at the core: everything will depend on it %28even the infrastructure%29 while the domain model itself will be clean, mantainable and ready for reuse.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b +Such design comes from the consideration that an enterprise application evolves over different, indipendent axes: +&lt%3bul&gt%3b +&lt%3bli&gt%3bthe tecnology changes with the skills of the developers involved %28and too often the marketing claims of few vendors%29&lt%3b/li&gt%3b +&lt%3bli&gt%3bthe customers&#39%3b requirements change as their business evolves&lt%3b/li&gt%3b +&lt%3bli&gt%3bthe user interface evolves through the users feedback %28but always depends on the handled business%29&lt%3b/li&gt%3b +&lt%3bli&gt%3bthe storage tecniques change with the load requirements and the usage patterns&lt%3b/li&gt%3b +&lt%3bli&gt%3bthe deploy depends on marketing strategies&lt%3b/li&gt%3b +&lt%3b/ul&gt%3b +Complex requirements lead to complex domain models. To keep such models clean and maintainable we have to decouple them from unrelated aspects such as presentation, logging, persistence and so on.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b +Epic makes the scene. + + + + + {@TokenFiles} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ee75a5a7a11a3a03e42ad90eb42aaf94a8b5bacb Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Sat, 4 Aug 2012 00:23:00 +0200 Subject: [PATCH 05/87] increased documentation --- Code/Epic.Core/Environment/EnvironmentBase.cs | 12 +- .../Environment/EnvironmentsChain.cs | 2 +- Code/Epic.Core/IEnvironment.cs | 2 +- Code/Epic.Core/ObserverBase.cs | 14 +- .../Organization/OrganizationBase.cs | 4 +- .../OrganizationSerializationHelper.cs | 4 +- Code/Epic.Core/Organization/RoleBase.cs | 11 ++ .../Organization/WorkingSessionBase.cs | 7 +- Code/Epic.Prelude/Collections/IMap.cs | 2 +- Code/Epic.Prelude/Collections/IdentityMap.cs | 30 ++++ .../Collections/KeyNotFoundException.cs | 9 ++ Code/Epic.Prelude/CompositeVisitor.cs | 6 +- Code/Epic.Prelude/CompositeVisitorBase.cs | 2 +- Code/Epic.Prelude/IVisitor.cs | 8 +- Code/Epic.Prelude/Math/IMapping.cs | 2 +- .../Specifications/ISpecification.cs | 4 +- .../Specifications/SpecificationBase.cs | 130 +++++++++++++++++- Code/Epic.Prelude/VisitContext.cs | 2 +- Code/Epic.Prelude/VisitableBase.cs | 3 + 19 files changed, 219 insertions(+), 35 deletions(-) diff --git a/Code/Epic.Core/Environment/EnvironmentBase.cs b/Code/Epic.Core/Environment/EnvironmentBase.cs index b409d8f1..ecb7dfec 100644 --- a/Code/Epic.Core/Environment/EnvironmentBase.cs +++ b/Code/Epic.Core/Environment/EnvironmentBase.cs @@ -34,7 +34,17 @@ public abstract class EnvironmentBase : IEnvironment, ISerializable { #region IEnvironment implementation - public abstract TObject Get (InstanceName name); + /// + /// Provide a tool or information from the enterprise environment. + /// + /// + /// An identifier for the needed object. + /// + /// + /// The required object. + /// + /// The provided do not match any property of the environment. + public abstract TObject Get (InstanceName name); #endregion diff --git a/Code/Epic.Core/Environment/EnvironmentsChain.cs b/Code/Epic.Core/Environment/EnvironmentsChain.cs index 2c666466..f33c4e97 100644 --- a/Code/Epic.Core/Environment/EnvironmentsChain.cs +++ b/Code/Epic.Core/Environment/EnvironmentsChain.cs @@ -65,7 +65,7 @@ public EnvironmentsChain (params EnvironmentChainLinkBase[] environmentsToChain) /// /// Type of the required tool or information. /// - /// The returned from the first chain link that knows it. + /// The returned from the first chain link that knows it. /// public override TObject Get (InstanceName name) { diff --git a/Code/Epic.Core/IEnvironment.cs b/Code/Epic.Core/IEnvironment.cs index 642adcca..1c6670a6 100644 --- a/Code/Epic.Core/IEnvironment.cs +++ b/Code/Epic.Core/IEnvironment.cs @@ -54,7 +54,7 @@ public interface IEnvironment /// /// The required object. /// - /// The provided do not match any property of the environment. + /// The provided do not match any property of the environment. TObject Get(InstanceName name); } } diff --git a/Code/Epic.Core/ObserverBase.cs b/Code/Epic.Core/ObserverBase.cs index fa140c51..fa3ecfbd 100644 --- a/Code/Epic.Core/ObserverBase.cs +++ b/Code/Epic.Core/ObserverBase.cs @@ -44,12 +44,6 @@ public abstract class ObserverBase : IDisposable /// /// Initializes a new instance of the observer. /// - /// - /// A delegate able to extract the identifiers of each entity. - /// - /// - /// Is thrown when is null. - /// protected ObserverBase () { } @@ -125,10 +119,10 @@ public void Ignore(TEntity entity) /// Unsubscribe all subscriptions done. /// /// - /// Call when you are finished using the . The - /// method leaves the in an unusable state. After - /// calling , you must release all references to the so - /// the garbage collector can reclaim the memory that the was occupying. + /// Call when you are finished using the . The + /// method leaves the in an unusable state. After + /// calling , you must release all references to the so + /// the garbage collector can reclaim the memory that the was occupying. /// public void Dispose () { diff --git a/Code/Epic.Core/Organization/OrganizationBase.cs b/Code/Epic.Core/Organization/OrganizationBase.cs index ab430c0e..17276a2c 100644 --- a/Code/Epic.Core/Organization/OrganizationBase.cs +++ b/Code/Epic.Core/Organization/OrganizationBase.cs @@ -134,7 +134,7 @@ public string Name /// is null. /// can not create a /// new . - /// + /// public void StartWorkingSession (IPrincipal owner, out IWorkingSession workingSession) { if(null == owner) @@ -178,7 +178,7 @@ public IWorkingSession AcquireWorkingSession (IPrincipal owner, string identifie /// /// /// Before disposing the working session will call the - /// so that + /// so that /// derived class will be able to log the operation. /// /// diff --git a/Code/Epic.Core/Organization/OrganizationSerializationHelper.cs b/Code/Epic.Core/Organization/OrganizationSerializationHelper.cs index b951859e..54230f2f 100644 --- a/Code/Epic.Core/Organization/OrganizationSerializationHelper.cs +++ b/Code/Epic.Core/Organization/OrganizationSerializationHelper.cs @@ -29,9 +29,9 @@ namespace Epic.Organization /// When deserialiing this object, return a reference to the . /// [Serializable] - public sealed class OrganizationSerializationHelper : IObjectReference + internal sealed class OrganizationSerializationHelper : IObjectReference { - public Object GetRealObject(StreamingContext context) + Object IObjectReference.GetRealObject(StreamingContext context) { // When deserialiing this object, return a reference to // the Enterprise.Organization. diff --git a/Code/Epic.Core/Organization/RoleBase.cs b/Code/Epic.Core/Organization/RoleBase.cs index 83fd4c00..7ade1915 100644 --- a/Code/Epic.Core/Organization/RoleBase.cs +++ b/Code/Epic.Core/Organization/RoleBase.cs @@ -32,11 +32,22 @@ namespace Epic.Organization [Serializable] public abstract class RoleBase : IDisposable { + /// + /// Initializes a new instance of the class. + /// protected RoleBase () { } #region IDisposable implementation + /// + /// Releases the responsibilities reppresented by the object. + /// + /// + /// will call when + /// the implemented role has been left with + /// as many time it has been achieved with . + /// public abstract void Dispose (); #endregion } diff --git a/Code/Epic.Core/Organization/WorkingSessionBase.cs b/Code/Epic.Core/Organization/WorkingSessionBase.cs index 147580ff..702e4ff3 100644 --- a/Code/Epic.Core/Organization/WorkingSessionBase.cs +++ b/Code/Epic.Core/Organization/WorkingSessionBase.cs @@ -77,6 +77,9 @@ protected IPrincipal Owner } } + /// + /// Throws when the session has been disposition. + /// protected void ThrowAfterDisposition() { if(_disposed) @@ -92,7 +95,7 @@ protected void ThrowAfterDisposition() /// /// Determines whether the owner of the working session is allowed to achieve - /// . + /// . /// /// /// true if the owner of the working session is allowed to achieve the role; @@ -201,7 +204,7 @@ public void Achieve (out TRole role) where TRole : class /// /// /// - /// The role will be disposed when the number of call to + /// The role will be disposed when the number of call to /// will be balanced with the calls to this method. /// /// diff --git a/Code/Epic.Prelude/Collections/IMap.cs b/Code/Epic.Prelude/Collections/IMap.cs index ff78c486..de05ed75 100644 --- a/Code/Epic.Prelude/Collections/IMap.cs +++ b/Code/Epic.Prelude/Collections/IMap.cs @@ -26,7 +26,7 @@ namespace Epic.Collections { /// - /// A map that provide access to + /// A map that provide access to /// given a . /// /// The type of keys in the map. diff --git a/Code/Epic.Prelude/Collections/IdentityMap.cs b/Code/Epic.Prelude/Collections/IdentityMap.cs index 3cafe75c..d37918bd 100644 --- a/Code/Epic.Prelude/Collections/IdentityMap.cs +++ b/Code/Epic.Prelude/Collections/IdentityMap.cs @@ -75,6 +75,14 @@ private void ThrowIfDisposed() } #region IMap implementation + + /// + /// Gets the with the specified key. + /// + /// + /// Key of interest. + /// + /// is null. public TEntity this[TIdentity key] { get @@ -114,6 +122,12 @@ void ISerializable.GetObjectData(SerializationInfo info, StreamingContext contex #endregion #region IDisposable implementation + /// + /// Releases all resource used by the object. + /// + /// + /// The different repositories must call when they are disposed. + /// public void Dispose () { Dictionary map = _map; @@ -124,6 +138,14 @@ public void Dispose () #endregion #region IIdentityMap implementation + /// + /// Register in the map the specified entity. + /// + /// + /// Entity to register. + /// + /// is null. + /// has already been registered. public void Register (TEntity entity) { ThrowIfDisposed(); @@ -138,6 +160,14 @@ public void Register (TEntity entity) _map[identity] = entity; } + /// + /// Determines if the map already knows the specified entity. + /// + /// + /// Identity of the entity of interest. + /// + /// trueif the map knows the specified entity, false otherwise. + /// is null. public bool Knows(TIdentity entity) { ThrowIfDisposed(); diff --git a/Code/Epic.Prelude/Collections/KeyNotFoundException.cs b/Code/Epic.Prelude/Collections/KeyNotFoundException.cs index 50c756e6..f34e4acb 100644 --- a/Code/Epic.Prelude/Collections/KeyNotFoundException.cs +++ b/Code/Epic.Prelude/Collections/KeyNotFoundException.cs @@ -81,6 +81,15 @@ private KeyNotFoundException(SerializationInfo info, StreamingContext context) _key = (TKey)info.GetValue("K", typeof(TKey)); } + /// + /// Gets the object data. + /// + /// + /// Info. + /// + /// + /// Context. + /// public override void GetObjectData (SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Code/Epic.Prelude/CompositeVisitor.cs b/Code/Epic.Prelude/CompositeVisitor.cs index 475cfe62..e59030af 100644 --- a/Code/Epic.Prelude/CompositeVisitor.cs +++ b/Code/Epic.Prelude/CompositeVisitor.cs @@ -32,7 +32,7 @@ namespace Epic /// Visitors' composition. It uses composition to handle the visit of any type of expression tree. /// /// Type of the result produced by the visit. - /// + /// public abstract class CompositeVisitor : IVisitor { private readonly List _chain; @@ -43,7 +43,7 @@ public abstract class CompositeVisitor : IVisitor /// Initializes a new instance of a composition. /// /// - /// This constructor is internal because clients have to derive . + /// This constructor is internal because clients have to derive . /// /// /// Name of the composition. @@ -239,7 +239,7 @@ protected TResult VisitInner(TExpression target, IVisitContext cont #region IVisitor[TResult] implementation /// - /// Return the visitor that can visit . + /// Return the visitor that can visit . /// /// /// The visitor. diff --git a/Code/Epic.Prelude/CompositeVisitorBase.cs b/Code/Epic.Prelude/CompositeVisitorBase.cs index f258451c..37fb848b 100644 --- a/Code/Epic.Prelude/CompositeVisitorBase.cs +++ b/Code/Epic.Prelude/CompositeVisitorBase.cs @@ -30,7 +30,7 @@ namespace Epic /// Visitors' composition base class. This class must be derived from concrete compositions. /// /// The type of the result produced by the visit. - /// The type of the expression to visit. + /// The type of the expression to visit. [DebuggerDisplay("CompositeVisitor<{typeof(TResult).Name, nq}, {typeof(TExpression).Name, nq}> {_name} ({_chain.Count} visitors)")] public abstract class CompositeVisitorBase : CompositeVisitor, IVisitor where TExpression : class diff --git a/Code/Epic.Prelude/IVisitor.cs b/Code/Epic.Prelude/IVisitor.cs index 0958cc2f..ad93bd28 100644 --- a/Code/Epic.Prelude/IVisitor.cs +++ b/Code/Epic.Prelude/IVisitor.cs @@ -29,11 +29,11 @@ namespace Epic /// Interface of visitors working together in a composition. /// /// Type of the result of the visit. - /// + /// public interface IVisitor { /// - /// Return the visitor that can visit . + /// Return the visitor that can visit . /// /// /// The visitor. @@ -60,8 +60,8 @@ public interface IVisitor : IVisitor /// /// Expression to visit. /// - /// - /// Visit state. The state can be provided from previous visitors. + /// + /// Visit context. Contains the state produced by previous visitors. /// /// Result of the visit. TResult Visit(TExpression target, IVisitContext context); diff --git a/Code/Epic.Prelude/Math/IMapping.cs b/Code/Epic.Prelude/Math/IMapping.cs index 6a2b10fc..f0a85a89 100644 --- a/Code/Epic.Prelude/Math/IMapping.cs +++ b/Code/Epic.Prelude/Math/IMapping.cs @@ -27,7 +27,7 @@ namespace Epic.Math { /// /// Reppresent a function that associate each instance of - /// to an instance of . + /// to an instance of . /// /// Type of the objects to map (the pre-image of the mapping). /// Type of the objects to map (the image of the mapping). diff --git a/Code/Epic.Prelude/Specifications/ISpecification.cs b/Code/Epic.Prelude/Specifications/ISpecification.cs index f1cd9a9c..6aa47638 100644 --- a/Code/Epic.Prelude/Specifications/ISpecification.cs +++ b/Code/Epic.Prelude/Specifications/ISpecification.cs @@ -44,10 +44,10 @@ public interface ISpecification : IEquatable - /// Check if the satisfy the specification. + /// Check if the satisfy the specification. /// /// - /// A . + /// A . /// /// /// Returns true when satisfies the specification, false otherwise. diff --git a/Code/Epic.Prelude/Specifications/SpecificationBase.cs b/Code/Epic.Prelude/Specifications/SpecificationBase.cs index 5c4e634a..57acd1ed 100644 --- a/Code/Epic.Prelude/Specifications/SpecificationBase.cs +++ b/Code/Epic.Prelude/Specifications/SpecificationBase.cs @@ -29,6 +29,13 @@ namespace Epic.Specifications /// /// Base class for specifications. /// + /// + /// + /// The constructor grant that the instance produced is assignable from . + /// + /// Moreover, the type initializer throws if + /// either is or is + /// /// Type of the specification implemented. /// Type of the candidates to satisfy the specification. [Serializable] @@ -50,6 +57,9 @@ static SpecificationBase () } } + /// + /// Initializes a new instance of the class. + /// protected SpecificationBase () { if (!(this is TSpecification)) { @@ -57,7 +67,16 @@ protected SpecificationBase () throw new InvalidOperationException (message); } } - + + /// + /// Throws if is null. + /// + /// + /// Other. + /// + /// + /// The 1st type parameter. + /// protected static void ThrowIfNull (ISpecification other) where T : class { @@ -66,6 +85,19 @@ protected static void ThrowIfNull (ISpecification other) } #region implemented abstract members of Epic.VisitableBase + /// + /// Accept the specified visitor and context as a . + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit result. + /// + /// or is null. public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this as TSpecification, visitor, context); @@ -73,16 +105,43 @@ public override TResult Accept (IVisitor visitor, IVisitContex #endregion #region IEquatable implementation + /// + /// Determines whether the specified is equal to the + /// current . + /// + /// + /// The to compare with the current instance. + /// + /// + /// true if the specified is equal to the + /// current ; otherwise, false. + /// public bool Equals (ISpecification other) { return Equals (other as TSpecification); } - + + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public override bool Equals (object obj) { return Equals (obj as TSpecification); } + /// + /// Serves as a hash function for a object. + /// + /// + /// The hash code of typeof(). + /// public override int GetHashCode () { // The HashCode of the TSpecification should be enough: it's strange @@ -92,6 +151,17 @@ public override int GetHashCode () #endregion #region IEquatable implementation + /// + /// Determines whether the specified is equal + /// to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to + /// the current ; otherwise, false. + /// public bool Equals (TSpecification other) { if (null == other) @@ -103,11 +173,32 @@ public bool Equals (TSpecification other) return EqualsA (other); } + /// + /// Determines whether the specified is equal + /// to the current . + /// + /// + /// true, if this is equal to , false otherwise. + /// + /// + /// Another specification instance, that is not null and has the same type + /// of this. + /// protected abstract bool EqualsA (TSpecification otherSpecification); #endregion #region ISpecification implementation + /// + /// Check if the satisfy the specification. + /// + /// + /// A . + /// + /// + /// Returns true when satisfies the specification, false otherwise. + /// Note that null can not satisfy any specification. + /// public bool IsSatisfiedBy (TCandidate candidate) { if (null == candidate) @@ -126,6 +217,15 @@ public bool IsSatisfiedBy (TCandidate candidate) /// protected abstract bool IsSatisfiedByA (TCandidate candidate); + /// + /// Create a new that evaluates the + /// only if the current specification is satisfied. + /// + /// The other specification to evaluate. + /// A new that evaluates the + /// only if the current specification is satisfied. + /// This method calls that can be overridden. + /// is null. public ISpecification And (ISpecification other) { ThrowIfNull (other); @@ -136,11 +236,27 @@ public ISpecification And (ISpecification other) return AndAlso (other); } + /// + /// Create a new that evaluates the + /// only if the current specification is satisfied. + /// + /// The other specification to evaluate (that will not be null). + /// A new that evaluates the + /// only if the current specification is satisfied. protected virtual ISpecification AndAlso (ISpecification other) { return new Conjunction (this, other); } + /// + /// Create a new that evaluates the + /// only if the current specification is not satisfied. + /// + /// The other specification to evaluate. + /// A new that evaluates the + /// only if the current specification is not satisfied. + /// This method calls that can be overridden. + /// is null. public ISpecification Or (ISpecification other) { ThrowIfNull (other); @@ -150,7 +266,15 @@ public ISpecification Or (ISpecification other) return other; return OrElse (other); } - + + /// + /// Create a new that evaluates the + /// only if the current specification is not satisfied. + /// + /// The other specification to evaluate (that will not be null). + /// A new that evaluates the + /// only if the current specification is not satisfied. + /// is null. protected virtual ISpecification OrElse (ISpecification other) { return new Disjunction (this, other); diff --git a/Code/Epic.Prelude/VisitContext.cs b/Code/Epic.Prelude/VisitContext.cs index a2cfc886..e448fe45 100644 --- a/Code/Epic.Prelude/VisitContext.cs +++ b/Code/Epic.Prelude/VisitContext.cs @@ -103,7 +103,7 @@ private sealed class State : IVisitContext private readonly TValue _state; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Next context to be looked for states. diff --git a/Code/Epic.Prelude/VisitableBase.cs b/Code/Epic.Prelude/VisitableBase.cs index b82f2f55..2eebf7dc 100644 --- a/Code/Epic.Prelude/VisitableBase.cs +++ b/Code/Epic.Prelude/VisitableBase.cs @@ -34,6 +34,9 @@ namespace Epic [Serializable] public abstract class VisitableBase : IVisitable { + /// + /// Initializes a new instance of the class. + /// protected VisitableBase () { } From bb06137a41b1a30e96a3cca9860b93cda0c92220 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Mon, 6 Aug 2012 19:13:18 +0200 Subject: [PATCH 06/87] modified Epic.API.shfbproj --- Documentation/Epic.API.shfbproj | 50 +++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/Documentation/Epic.API.shfbproj b/Documentation/Epic.API.shfbproj index 43bbb400..70935151 100644 --- a/Documentation/Epic.API.shfbproj +++ b/Documentation/Epic.API.shfbproj @@ -20,14 +20,16 @@ en-US MemberName True - vs2005 + Epic.Prototype CSharp Website True - Copyright %28c%29 2010-2012 Giacomo Tesio - mailto:giacomo%40tesio.it + + + + Epic.NET - Attributes, InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected, SealedProtected + Attributes, Protected, ProtectedInternalAsProtected, SealedProtected Epic is an open source framework designed to keep your domain model implementation fully focused on the enterprise business targeted by the application, with an infrastructure ignorant fashion.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b It achieves a new kind of dependency inversion, where the domain model settles at the core: everything will depend on it %28even the infrastructure%29 while the domain model itself will be clean, mantainable and ready for reuse.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b Such design comes from the consideration that an enterprise application evolves over different, indipendent axes: @@ -45,31 +47,37 @@ Epic makes the scene. {@TokenFiles} - - + - - - - - - - - - - - + + + + - - - - + + + + + + API - ..\build\doc\ + ..\build\tmp\api\ Documentation en-US MemberName @@ -30,18 +30,8 @@ Epic.NET Attributes, Protected, ProtectedInternalAsProtected, SealedProtected - Epic is an open source framework designed to keep your domain model implementation fully focused on the enterprise business targeted by the application, with an infrastructure ignorant fashion.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b -It achieves a new kind of dependency inversion, where the domain model settles at the core: everything will depend on it %28even the infrastructure%29 while the domain model itself will be clean, mantainable and ready for reuse.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b -Such design comes from the consideration that an enterprise application evolves over different, indipendent axes: -&lt%3bul&gt%3b -&lt%3bli&gt%3bthe tecnology changes with the skills of the developers involved %28and too often the marketing claims of few vendors%29&lt%3b/li&gt%3b -&lt%3bli&gt%3bthe customers&#39%3b requirements change as their business evolves&lt%3b/li&gt%3b -&lt%3bli&gt%3bthe user interface evolves through the users feedback %28but always depends on the handled business%29&lt%3b/li&gt%3b -&lt%3bli&gt%3bthe storage tecniques change with the load requirements and the usage patterns&lt%3b/li&gt%3b -&lt%3bli&gt%3bthe deploy depends on marketing strategies&lt%3b/li&gt%3b -&lt%3b/ul&gt%3b -Complex requirements lead to complex domain models. To keep such models clean and maintainable we have to decouple them from unrelated aspects such as presentation, logging, persistence and so on.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b -Epic makes the scene. + The Epic.NET code base consists of many different libraries that can work together in various combination, thanks to carefully designed responsibilities that lead to high cohesion and low coupling.&lt%3bbr/&gt%3b&lt%3bbr/&gt%3b +TThis is the reference documentation of such libraries %28whose objectives has been described in the &lt%3ba href=&quot%3bhttp://epic.tesio.it/doc/the_bellis_perennis.html&quot%3b&gt%3bsecond part of the manual&lt%3b/a&gt%3b%29. There&#39%3bs no convention between DLL&#39%3bs names and namespaces, so that for example you will not find an Epic.Prelude namespace: while each library&#39%3bs name maps its usage pattern, namespaces express the logical organization of the modelled concepts. @@ -79,6 +69,13 @@ Epic makes the scene. API False + + The <b>Epic</b> namespace contains fundamental concepts that all Domain Driven applications built with the Epic's modeling patterns in mind will require.<br/><br/> + +Epic.Prelude defines here <a href="T_Epic_IVisitable.htm">IVisitable</a> interface and the <b>Composite Visitor pattern</b>. <br/> +Epic.Core defines the <a href="T_Epic_Enterprise.htm">Enterprise</a> entry point to the domain model. +The <b>Epic.Collections</b> namespace contains useful models of collections for DDD.<br/> +It's defined in Epic.Prelude. + workingdir="${documentation.dir}" > + + + + + + - + @@ -133,7 +141,7 @@ - + From de3d2efc5d1926d516d59634e23e250fcba8a8cc Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Wed, 8 Aug 2012 01:33:42 +0200 Subject: [PATCH 13/87] some more fix to continuous.build --- continuous.build | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/continuous.build b/continuous.build index 7f47fe6b..2e911bcf 100644 --- a/continuous.build +++ b/continuous.build @@ -112,8 +112,6 @@ - @@ -121,10 +119,9 @@ - - + From 2f6410a8d2cc5a43ff1e104673cd9aaa8798ba35 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Wed, 8 Aug 2012 10:01:07 +0300 Subject: [PATCH 14/87] Better logs into continuous.nant --- continuous.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/continuous.build b/continuous.build index 2e911bcf..41fb846c 100644 --- a/continuous.build +++ b/continuous.build @@ -22,6 +22,7 @@ + @@ -111,7 +112,7 @@ - + @@ -119,6 +120,7 @@ + @@ -136,6 +138,7 @@ + From 3cf7a2bb308dcb44b644ee9d020c90da5834e23a Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Thu, 9 Aug 2012 01:04:54 +0200 Subject: [PATCH 15/87] improved documentation --- Code/Epic.Core/Organization/RoleBase.cs | 109 ++++---- Code/Epic.Prelude/Specifications/OfType.cs | 235 +++++++++++------- .../Normalization/ClosureExpander.cs | 4 +- .../Normalization/DefaultNormalizer.cs | 10 + .../Normalization/EnumerableMethodsReducer.cs | 38 +++ .../Normalization/ExpressionForwarder.cs | 5 +- .../Normalization/ExpressionNormalizerBase.cs | 2 +- .../Normalization/ExpressionsInspector.cs | 4 +- .../Normalization/PartialEvaluator.cs | 2 +- .../QueryableConstantResolver.cs | 2 +- .../Normalization/QueryableMethodsReducer.cs | 2 +- Code/Epic.Query.Linq/QueryProvider.cs | 8 +- Code/Epic.Query.Linq/Queryable.cs | 4 +- Code/Epic.Query.Linq/Reflection.cs | 4 +- Code/Epic.Query.Linq/RepositoryBase.cs | 14 +- Code/Epic.Query/Relational/BaseRelation.cs | 24 +- Code/Epic.Query/Relational/Constant.cs | 61 ++++- Code/Epic.Query/Relational/Predicates/And.cs | 14 +- .../Predicates/BinaryPredicateBase.cs | 16 +- .../Epic.Query/Relational/Predicates/Equal.cs | 14 +- .../Relational/Predicates/Greater.cs | 14 +- Code/Epic.Query/Relational/Predicates/Less.cs | 14 +- Code/Epic.Query/Relational/Predicates/Not.cs | 14 +- Code/Epic.Query/Relational/Predicates/Or.cs | 14 +- .../Relational/Predicates/Predicate.cs | 14 +- .../Predicates/ScalarPredicateBase.cs | 16 +- .../Predicates/UnaryPredicateBase.cs | 18 +- Code/Epic.Query/Relational/Predicates/Xor.cs | 14 +- Code/Epic.Query/Relational/Relation.cs | 16 +- .../Relational/RelationAttribute.cs | 22 +- .../Epic.Query/Relational/RelationFunction.cs | 16 +- Code/Epic.Query/Relational/Scalar.cs | 8 +- Code/Epic.Query/Relational/ScalarFunction.cs | 16 +- .../QueryableConstantResolverQA.cs | 6 +- .../Fakes/DummyResultExpression.cs | 2 +- .../Fakes/UnknownExpression.cs | 2 +- 36 files changed, 478 insertions(+), 300 deletions(-) diff --git a/Code/Epic.Core/Organization/RoleBase.cs b/Code/Epic.Core/Organization/RoleBase.cs index 7ade1915..398a08df 100644 --- a/Code/Epic.Core/Organization/RoleBase.cs +++ b/Code/Epic.Core/Organization/RoleBase.cs @@ -1,55 +1,54 @@ -// -// RoleBase.cs -// -// Author: -// Giacomo Tesio -// -// Copyright (c) 2010-2012 Giacomo Tesio -// -// This file is part of Epic.NET. -// -// Epic.NET is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Epic.NET is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -using System; - -namespace Epic.Organization -{ - /// - /// Base class for users' roles. - /// - // TODO: Verify if really needed, or it's better to replace it with IDisposable. - [Serializable] - public abstract class RoleBase : IDisposable - { - /// - /// Initializes a new instance of the class. - /// - protected RoleBase () - { - } - - #region IDisposable implementation - /// - /// Releases the responsibilities reppresented by the object. - /// - /// - /// will call when - /// the implemented role has been left with - /// as many time it has been achieved with . - /// - public abstract void Dispose (); - #endregion - } -} - +// +// RoleBase.cs +// +// Author: +// Giacomo Tesio +// +// Copyright (c) 2010-2012 Giacomo Tesio +// +// This file is part of Epic.NET. +// +// Epic.NET is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Epic.NET is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +using System; + +namespace Epic.Organization +{ + /// + /// Base class for users' roles. + /// + [Serializable] + public abstract class RoleBase : IDisposable + { + /// + /// Initializes a new instance of the class. + /// + protected RoleBase () + { + } + + #region IDisposable implementation + /// + /// Releases the responsibilities reppresented by the object. + /// + /// + /// will call when + /// the implemented role has been left with + /// as many time it has been achieved with . + /// + public abstract void Dispose (); + #endregion + } +} + diff --git a/Code/Epic.Prelude/Specifications/OfType.cs b/Code/Epic.Prelude/Specifications/OfType.cs index f0878cb7..9026d8de 100644 --- a/Code/Epic.Prelude/Specifications/OfType.cs +++ b/Code/Epic.Prelude/Specifications/OfType.cs @@ -1,94 +1,141 @@ -// -// OfType.cs -// -// Author: -// Giacomo Tesio -// -// Copyright (c) 2010-2012 Giacomo Tesio -// -// This file is part of Epic.NET. -// -// Epic.NET is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Epic.NET is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -using System; - -namespace Epic.Specifications -{ - /// - /// Specification that is satisfied by any that is a - /// satisfing the inner specification. - /// - /// Type of the objects that can be tested with this specification. - /// Type of the objects that can be tested with inner specification. - [Serializable] - public sealed class OfType : SpecificationBase, TCandidate>, - IEquatable> - where TCandidate : class - where TInitial : class - { - static OfType () - { - if (!typeof(TCandidate).IsAssignableFrom (typeof(TInitial)) && !typeof(TInitial).IsAssignableFrom (typeof(TCandidate))) { - string message = string.Format ("Cannot cast neither from {0} to {1} nor from {1} to {0}.", typeof(TInitial), typeof(TCandidate)); - throw new InvalidCastException (message); - } - if (typeof(TCandidate).Equals(typeof(TInitial))) - { - string message = string.Format ("Cannot create an OfType<{1}, {0}>, becouse the two type arguments are equals.", typeof(TInitial), typeof(TCandidate)); - throw new InvalidCastException (message); - } - } - - private readonly ISpecification _innerSpecification; - - public ISpecification InnerSpecification - { - get - { - return _innerSpecification; - } - } - - public OfType (ISpecification innerSpecification) - { - if (null == innerSpecification) - throw new ArgumentNullException ("innerSpecification"); - _innerSpecification = innerSpecification; - } - - #region implemented abstract members of Epic.Specifications.SpecificationBase - protected override bool EqualsA (OfType otherSpecification) - { - return _innerSpecification.Equals (otherSpecification._innerSpecification); - } - - protected override bool IsSatisfiedByA (TCandidate candidate) - { - return _innerSpecification.IsSatisfiedBy (candidate as TInitial); - } - - protected override ISpecification OfAnotherType () - { - return _innerSpecification.OfType (); - } - - protected override Type FirstCandidateType { - get { - return _innerSpecification.CandidateType; - } - } - #endregion - } -} - +// +// OfType.cs +// +// Author: +// Giacomo Tesio +// +// Copyright (c) 2010-2012 Giacomo Tesio +// +// This file is part of Epic.NET. +// +// Epic.NET is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Epic.NET is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +using System; + +namespace Epic.Specifications +{ + /// + /// Specification that is satisfied by any that is a + /// satisfing the inner specification. + /// + /// Type of the objects that can be tested with this specification. + /// Type of the objects that can be tested with inner specification. + [Serializable] + public sealed class OfType : SpecificationBase, TCandidate>, + IEquatable> + where TCandidate : class + where TInitial : class + { + static OfType () + { + if (!typeof(TCandidate).IsAssignableFrom (typeof(TInitial)) && !typeof(TInitial).IsAssignableFrom (typeof(TCandidate))) { + string message = string.Format ("Cannot cast neither from {0} to {1} nor from {1} to {0}.", typeof(TInitial), typeof(TCandidate)); + throw new InvalidCastException (message); + } + if (typeof(TCandidate).Equals(typeof(TInitial))) + { + string message = string.Format ("Cannot create an OfType<{1}, {0}>, becouse the two type arguments are equals.", typeof(TInitial), typeof(TCandidate)); + throw new InvalidCastException (message); + } + } + + private readonly ISpecification _innerSpecification; + + /// + /// The that must be satisfied by for this specification. + /// + public ISpecification InnerSpecification + { + get + { + return _innerSpecification; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// Specification that must be satisfied by any to satisfy the current specification. + /// + /// is null. + public OfType (ISpecification innerSpecification) + { + if (null == innerSpecification) + throw new ArgumentNullException ("innerSpecification"); + _innerSpecification = innerSpecification; + } + + #region implemented abstract members of Epic.Specifications.SpecificationBase + + /// + /// Determines whether the specified is equal to the current one. + /// + /// + /// true, if has the same + /// of the current instance, false otherwise. + /// + /// + /// Other specification. + /// + protected override bool EqualsA (OfType otherSpecification) + { + return _innerSpecification.Equals (otherSpecification._innerSpecification); + } + + /// + /// Determines whether this specification is satisfied by a the specified . + /// + /// + /// true if is a that satisfy + /// the ; otherwise, false. + /// + /// + /// Candidate. + /// + protected override bool IsSatisfiedByA (TCandidate candidate) + { + return _innerSpecification.IsSatisfiedBy (candidate as TInitial); + } + + /// + /// Return the specification produced by the method + /// of the . + /// + /// + /// A specifications satisfied by that + /// satisfy this specification. + /// + /// + /// One of types admitted to satisfy the . + /// + /// No instance of can + /// satisfy the . + protected override ISpecification OfAnotherType () + { + return _innerSpecification.OfType (); + } + + /// + /// . + /// + protected override Type FirstCandidateType { + get { + return _innerSpecification.CandidateType; + } + } + #endregion + } +} + diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/ClosureExpander.cs b/Code/Epic.Query.Linq/Expressions/Normalization/ClosureExpander.cs index e3937785..746f7339 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/ClosureExpander.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/ClosureExpander.cs @@ -31,11 +31,11 @@ namespace Epic.Query.Linq.Expressions.Normalization /// Closure expander. Replace a "closure" with its value. /// Closures are defined _here_ as accesses to fields or properties of a . /// - /// + /// public sealed class ClosureExpander : CompositeVisitor.VisitorBase, IVisitor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Composition that will own this visitor. diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/DefaultNormalizer.cs b/Code/Epic.Query.Linq/Expressions/Normalization/DefaultNormalizer.cs index 606a4122..55e54767 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/DefaultNormalizer.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/DefaultNormalizer.cs @@ -25,8 +25,18 @@ namespace Epic.Query.Linq.Expressions.Normalization { + /// + /// Default normalizer. + /// public class DefaultNormalizer : ExpressionNormalizerBase { + /// + /// Initializes a new instance of the class. + /// + /// + /// Name of the normalizer. + /// + /// is null or . public DefaultNormalizer (string name) : base(name) { diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/EnumerableMethodsReducer.cs b/Code/Epic.Query.Linq/Expressions/Normalization/EnumerableMethodsReducer.cs index b77a1e05..408d958d 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/EnumerableMethodsReducer.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/EnumerableMethodsReducer.cs @@ -29,13 +29,38 @@ namespace Epic.Query.Linq.Expressions.Normalization { + /// + /// Reduce expressing methods of to either their equivalent value + /// or an equivalent call to the methods (when the source is actually a queryable and we can translate all the arguments). + /// public sealed class EnumerableMethodsReducer : CompositeVisitor.VisitorBase, IVisitor { + /// + /// Initializes a new instance of the + /// class. + /// + /// + /// Composition that will own the new instance. + /// + /// is null. public EnumerableMethodsReducer (CompositeVisitor composition) : base(composition) { } + /// + /// Return the current instance as a visitor of if it's a + /// related to any 's method. + /// + /// + /// The visitor. + /// + /// + /// Target. + /// + /// + /// Type of the expression to be visited. + /// protected override IVisitor AsVisitor(TExpression target) { IVisitor visitor = base.AsVisitor (target); @@ -51,6 +76,19 @@ protected override IVisitor AsVisitor(TExp } #region IVisitor[Expression,MethodCallExpression] implementation + /// + /// Visit the specified expression, reducing all expressing methods of to either their equivalent value + /// or an equivalent call to the methods (when the source is actually a queryable and we can translate all the arguments). + /// + /// + /// Expression to visit. + /// + /// + /// Visit context. Contains the state produced by previous visitors. + /// + /// + /// Result of the visit. + /// public Expression Visit (MethodCallExpression target, IVisitContext context) { MethodInfo targetMethod = target.Method; diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionForwarder.cs b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionForwarder.cs index acf4b358..06950a5d 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionForwarder.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionForwarder.cs @@ -28,15 +28,16 @@ namespace Epic.Query.Linq.Expressions.Normalization { /// /// Visitor that forward to the composition the visit of each - /// according to its type. + /// according to its type. /// /// /// Is thrown when the expression provided is not known. /// + // TODO: refactor for .NET 4.0 internal sealed class ExpressionForwarder : CompositeVisitor.VisitorBase, IVisitor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Composition that will own this visitor. diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionNormalizerBase.cs b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionNormalizerBase.cs index 230878b0..04dd587a 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionNormalizerBase.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionNormalizerBase.cs @@ -38,7 +38,7 @@ namespace Epic.Query.Linq.Expressions.Normalization public abstract class ExpressionNormalizerBase : CompositeVisitorBase { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected ExpressionNormalizerBase (string name) : base(name) diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionsInspector.cs b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionsInspector.cs index efaa5759..b2574382 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionsInspector.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/ExpressionsInspector.cs @@ -56,7 +56,7 @@ internal sealed class ExpressionsInspector : CompositeVisitor.Visito IVisitor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Composition that owns this visitor. @@ -322,7 +322,7 @@ public Expression Visit (MemberInitExpression expression, IVisitContext context) /// Context. /// /// - /// Is thrown when the visit of the does not return a . + /// Is thrown when the visit of the does not return a . /// public Expression Visit (ListInitExpression expression, IVisitContext context) { diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/PartialEvaluator.cs b/Code/Epic.Query.Linq/Expressions/Normalization/PartialEvaluator.cs index 9b9a7b0f..27d6f942 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/PartialEvaluator.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/PartialEvaluator.cs @@ -36,7 +36,7 @@ public sealed class PartialEvaluator : CompositeVisitor.VisitorBase, IVisitor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Composition that will own this visitor. diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/QueryableConstantResolver.cs b/Code/Epic.Query.Linq/Expressions/Normalization/QueryableConstantResolver.cs index cf6af2aa..1fcda68a 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/QueryableConstantResolver.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/QueryableConstantResolver.cs @@ -36,7 +36,7 @@ namespace Epic.Query.Linq.Expressions.Normalization public sealed class QueryableConstantResolver : CompositeVisitor.VisitorBase, IVisitor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Composition that will own this visitor. diff --git a/Code/Epic.Query.Linq/Expressions/Normalization/QueryableMethodsReducer.cs b/Code/Epic.Query.Linq/Expressions/Normalization/QueryableMethodsReducer.cs index 0011461d..034fd298 100644 --- a/Code/Epic.Query.Linq/Expressions/Normalization/QueryableMethodsReducer.cs +++ b/Code/Epic.Query.Linq/Expressions/Normalization/QueryableMethodsReducer.cs @@ -38,7 +38,7 @@ public sealed class QueryableMethodsReducer : CompositeVisitor.Visit { /// /// Initializes a new instance of the - /// class. + /// class. /// /// /// Composition that will own this visitor. diff --git a/Code/Epic.Query.Linq/QueryProvider.cs b/Code/Epic.Query.Linq/QueryProvider.cs index 5f0cdf91..fdf9a938 100644 --- a/Code/Epic.Query.Linq/QueryProvider.cs +++ b/Code/Epic.Query.Linq/QueryProvider.cs @@ -41,7 +41,7 @@ internal sealed class QueryProvider : IQueryProvider /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Name of the query provider. Used to get tools from the . @@ -75,8 +75,8 @@ public string Name /// Constructs an IQueryable object that can evaluate the query represented by a specified expression tree. /// /// - /// Several of the standard query operator methods defined in Queryable, such as - /// and , call this method. They pass it a MethodCallExpression that represents a LINQ query. + /// Several of the standard query operator methods defined in Queryable, such as + /// and , call this method. They pass it a MethodCallExpression that represents a LINQ query. /// /// /// The query. @@ -85,7 +85,7 @@ public string Name /// An expression tree that represents a LINQ query. /// /// - /// Is thrown when is not assignable from . + /// Is thrown when is not assignable from . /// public IQueryable CreateQuery (System.Linq.Expressions.Expression expression) { diff --git a/Code/Epic.Query.Linq/Queryable.cs b/Code/Epic.Query.Linq/Queryable.cs index acabdca3..d43a8f10 100644 --- a/Code/Epic.Query.Linq/Queryable.cs +++ b/Code/Epic.Query.Linq/Queryable.cs @@ -1,4 +1,4 @@ -// +// // Queryable.cs // // Author: @@ -41,7 +41,7 @@ internal sealed class Queryable : IQueryable, IQueryable, IEnumerable, private readonly System.Linq.Expressions.Expression _expression; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Provider. diff --git a/Code/Epic.Query.Linq/Reflection.cs b/Code/Epic.Query.Linq/Reflection.cs index 19452c50..09c1a347 100644 --- a/Code/Epic.Query.Linq/Reflection.cs +++ b/Code/Epic.Query.Linq/Reflection.cs @@ -1462,8 +1462,8 @@ static Enumerable() /// /// Returns the semantic equivalent of in the class. /// - /// Enumerable method to translate. - /// The Queryable's equivalent of . + /// Enumerable method to translate. + /// The Queryable's equivalent of . /// Thrown when is null. /// Thrown when doesn't belong to . /// The has no equivalent in . diff --git a/Code/Epic.Query.Linq/RepositoryBase.cs b/Code/Epic.Query.Linq/RepositoryBase.cs index 3a92a150..a79a65db 100644 --- a/Code/Epic.Query.Linq/RepositoryBase.cs +++ b/Code/Epic.Query.Linq/RepositoryBase.cs @@ -28,6 +28,9 @@ namespace Epic.Query.Linq { + /// + /// Base class for Linq based repositories. + /// [Serializable] public abstract class RepositoryBase : IQueryableRepository, IQueryable, IQueryable, IEnumerable, IEnumerable where TEntity : class @@ -42,7 +45,7 @@ public abstract class RepositoryBase : IQueryableRepository< private IQueryProvider _provider; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Provider name in the Environment. @@ -55,6 +58,13 @@ protected RepositoryBase (string providerName) } #region IRepository[TEntity,TIdentity] implementation + /// + /// Gets the with the specified identity. + /// + /// + /// Identity. + /// + /// is null. public TEntity this[TIdentity identity] { get { throw new NotImplementedException (); @@ -111,7 +121,7 @@ public IQueryProvider Provider { #region IEnumerable[T] implementation /// - /// Returns an enumerator that iterates through a collection of . + /// Returns an enumerator that iterates through a collection of . /// /// /// The enumerator. diff --git a/Code/Epic.Query/Relational/BaseRelation.cs b/Code/Epic.Query/Relational/BaseRelation.cs index 03cc28d2..b475115d 100644 --- a/Code/Epic.Query/Relational/BaseRelation.cs +++ b/Code/Epic.Query/Relational/BaseRelation.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational public sealed class BaseRelation : Relation { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Name of the relation. @@ -41,13 +41,33 @@ public BaseRelation (string name) : base(RelationType.BaseRelation, name) { } - + + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified has the same name of the current + /// ; otherwise, false. + /// private bool Equals(BaseRelation other) { return Name.Equals(other.Name); } #region implemented abstract members of Epic.Linq.Expressions.Relational.Relation + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public override bool Equals (Relation other) { if(null == other) diff --git a/Code/Epic.Query/Relational/Constant.cs b/Code/Epic.Query/Relational/Constant.cs index 9681128b..d681956e 100644 --- a/Code/Epic.Query/Relational/Constant.cs +++ b/Code/Epic.Query/Relational/Constant.cs @@ -1,4 +1,4 @@ -// +// // Constant.cs // // Author: @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// +// using System; using System.Collections.Generic; @@ -29,6 +29,7 @@ namespace Epic.Query.Relational /// /// Constant value in a relational predicate. /// + /// This abstract class cannot be inherited on its own: you must derive . [Serializable] public abstract class Constant : Scalar, IEquatable { @@ -37,9 +38,29 @@ internal Constant(): base(ScalarType.Constant) } #region IEquatable[Constant] implementation + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public abstract bool Equals (Constant other); #endregion + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public override bool Equals (Scalar other) { return Equals (other as Constant); @@ -55,7 +76,7 @@ public sealed class Constant : Constant, IEquatable> private readonly TValue _value; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Value of the constant. @@ -99,6 +120,20 @@ public override TResult Accept (IVisitor visitor, IVisitContex #endregion #region IEquatable[Constant[TValue]] implementation + /// + /// Determines whether the specified is equal to the + /// current . + /// + /// + /// is used to test the for equality. + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified express the same value of the current + /// ; otherwise, false. + /// public bool Equals (Constant other) { if(null == other) @@ -108,12 +143,30 @@ public bool Equals (Constant other) #endregion #region IEquatable[Constant] implementation + /// + /// Determines whether the specified express + /// the same value of the current . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public override bool Equals (Constant other) { return Equals(other as Constant); } #endregion - + + /// + /// Serves as a hash function for a object. + /// + /// + /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a + /// hash table. + /// public override int GetHashCode () { if(null == (object)_value) diff --git a/Code/Epic.Query/Relational/Predicates/And.cs b/Code/Epic.Query/Relational/Predicates/And.cs index 6006b147..f28d0d46 100644 --- a/Code/Epic.Query/Relational/Predicates/And.cs +++ b/Code/Epic.Query/Relational/Predicates/And.cs @@ -33,7 +33,7 @@ public sealed class And : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -48,14 +48,14 @@ public And (Predicate leftOperand, Predicate rightOperand) /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the - /// current ; otherwise, false. + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals (And other) { diff --git a/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs index f9c357a0..e75863d4 100644 --- a/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs @@ -37,7 +37,7 @@ public abstract class BinaryPredicateBase : Predicate, IEquatable /// Initializes a new instance of the - /// class. + /// class. /// /// /// Left operand of the predicate. Cannot be . @@ -73,26 +73,26 @@ protected BinaryPredicateBase (Predicate leftOperand, Predicate rightOperand) public Predicate Right { get { return this._right; } } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the - /// current ; otherwise, false. + /// current ; otherwise, false. /// public abstract bool Equals(BinaryPredicateBase other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Predicate other) { @@ -101,7 +101,7 @@ public override bool Equals (Predicate other) /// /// Serves as a hash function for a - /// object. + /// object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/Equal.cs b/Code/Epic.Query/Relational/Predicates/Equal.cs index 212a22b1..e0fbc5d9 100644 --- a/Code/Epic.Query/Relational/Predicates/Equal.cs +++ b/Code/Epic.Query/Relational/Predicates/Equal.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Equal : ScalarPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -48,14 +48,14 @@ public Equal (Scalar leftOperand, Scalar rightOperand) /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (ScalarPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals(Equal other) { diff --git a/Code/Epic.Query/Relational/Predicates/Greater.cs b/Code/Epic.Query/Relational/Predicates/Greater.cs index d8d74bc7..cc60c273 100644 --- a/Code/Epic.Query/Relational/Predicates/Greater.cs +++ b/Code/Epic.Query/Relational/Predicates/Greater.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Greater: ScalarPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -46,14 +46,14 @@ public Greater (Scalar leftOperand, Scalar rightOperand): base(leftOperand, righ /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (ScalarPredicateBase other) { @@ -61,14 +61,14 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals(Greater other) { diff --git a/Code/Epic.Query/Relational/Predicates/Less.cs b/Code/Epic.Query/Relational/Predicates/Less.cs index 0a9c406a..a08944f6 100644 --- a/Code/Epic.Query/Relational/Predicates/Less.cs +++ b/Code/Epic.Query/Relational/Predicates/Less.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Less : ScalarPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -48,14 +48,14 @@ public Less (Scalar leftOperand, Scalar rightOperand) /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (ScalarPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals(Less other) { diff --git a/Code/Epic.Query/Relational/Predicates/Not.cs b/Code/Epic.Query/Relational/Predicates/Not.cs index 9617f915..7728d01c 100644 --- a/Code/Epic.Query/Relational/Predicates/Not.cs +++ b/Code/Epic.Query/Relational/Predicates/Not.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Not : UnaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Operand. @@ -42,14 +42,14 @@ public Not (Predicate operand): base(operand) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (UnaryPredicateBase other) { @@ -57,14 +57,14 @@ public override bool Equals (UnaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals(Not other) { diff --git a/Code/Epic.Query/Relational/Predicates/Or.cs b/Code/Epic.Query/Relational/Predicates/Or.cs index fb13193a..04ef09a7 100644 --- a/Code/Epic.Query/Relational/Predicates/Or.cs +++ b/Code/Epic.Query/Relational/Predicates/Or.cs @@ -33,7 +33,7 @@ public sealed class Or : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -48,14 +48,14 @@ public Or (Predicate leftOperand, Predicate rightOperand) /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the - /// current ; otherwise, false. + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals (Or other) { diff --git a/Code/Epic.Query/Relational/Predicates/Predicate.cs b/Code/Epic.Query/Relational/Predicates/Predicate.cs index 1100b4d1..e7d599bc 100644 --- a/Code/Epic.Query/Relational/Predicates/Predicate.cs +++ b/Code/Epic.Query/Relational/Predicates/Predicate.cs @@ -33,34 +33,34 @@ public abstract class Predicate : VisitableBase, IEquatable { #region IEquatable[Predicate] implementation /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals (Predicate other); #endregion /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (object obj) { return Equals (obj as Predicate); } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs index 6a7a8219..132f5102 100644 --- a/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs @@ -37,7 +37,7 @@ public abstract class ScalarPredicateBase : Predicate, IEquatable /// Initializes a new instance of the - /// class. + /// class. /// /// /// Left operand of the predicate. Cannot be . @@ -73,26 +73,26 @@ internal protected ScalarPredicateBase (Scalar leftOperand, Scalar rightOperand) public Scalar Right { get { return this._right; } } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals(ScalarPredicateBase other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Predicate other) { @@ -101,7 +101,7 @@ public override bool Equals (Predicate other) /// /// Serves as a hash function for a - /// object. + /// object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs index 28b48506..b3e80db7 100644 --- a/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs @@ -36,7 +36,7 @@ public abstract class UnaryPredicateBase : Predicate, IEquatable /// Initializes a new instance of the - /// class. + /// class. /// /// /// The operand of the predicate. Cannot be - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public abstract bool Equals(UnaryPredicateBase other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals(Predicate other) { @@ -87,7 +87,7 @@ public override bool Equals(Predicate other) /// /// Serves as a hash function for a - /// object. + /// object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/Xor.cs b/Code/Epic.Query/Relational/Predicates/Xor.cs index 1496f26a..5e1fe55e 100644 --- a/Code/Epic.Query/Relational/Predicates/Xor.cs +++ b/Code/Epic.Query/Relational/Predicates/Xor.cs @@ -33,7 +33,7 @@ public sealed class Xor : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -48,14 +48,14 @@ public Xor (Predicate leftOperand, Predicate rightOperand) /// /// Determines whether the specified is equal to the - /// current . + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the - /// current ; otherwise, false. + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals (Xor other) { diff --git a/Code/Epic.Query/Relational/Relation.cs b/Code/Epic.Query/Relational/Relation.cs index cd92aaa1..eb257a36 100644 --- a/Code/Epic.Query/Relational/Relation.cs +++ b/Code/Epic.Query/Relational/Relation.cs @@ -38,7 +38,7 @@ public abstract class Relation : VisitableBase, IEquatable private readonly string _name; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Type of the relation. @@ -82,28 +82,28 @@ public string Name #region IEquatable[Relation] implementation /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals (Relation other); #endregion /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (object obj) { @@ -111,7 +111,7 @@ public override bool Equals (object obj) } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/RelationAttribute.cs b/Code/Epic.Query/Relational/RelationAttribute.cs index 69efdf67..b393f167 100644 --- a/Code/Epic.Query/Relational/RelationAttribute.cs +++ b/Code/Epic.Query/Relational/RelationAttribute.cs @@ -38,7 +38,7 @@ public sealed class RelationAttribute: Scalar, IEquatable private readonly Relation _relation; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Name of the attribute. @@ -76,7 +76,7 @@ public RelationAttribute (string name, Relation relation):base(ScalarType.Attrib public Relation Relation { get { return this._relation; } } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a @@ -88,14 +88,14 @@ public override int GetHashCode () } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public bool Equals (RelationAttribute other) { @@ -104,14 +104,14 @@ public bool Equals (RelationAttribute other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals(Scalar other) { @@ -119,14 +119,14 @@ public override bool Equals(Scalar other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (object obj) { diff --git a/Code/Epic.Query/Relational/RelationFunction.cs b/Code/Epic.Query/Relational/RelationFunction.cs index fc10ce88..87d0684b 100644 --- a/Code/Epic.Query/Relational/RelationFunction.cs +++ b/Code/Epic.Query/Relational/RelationFunction.cs @@ -26,13 +26,13 @@ namespace Epic.Query.Relational { /// - /// Models a function which has a as output. + /// Models a function which has a as output. /// [Serializable] public abstract class RelationFunction: Relation { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The function name. @@ -42,14 +42,14 @@ public RelationFunction (string name): base(RelationType.Function, name) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// /// /// Is thrown when the not implemented exception. @@ -57,14 +57,14 @@ public RelationFunction (string name): base(RelationType.Function, name) public abstract bool Equals (RelationFunction other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Relation other) { diff --git a/Code/Epic.Query/Relational/Scalar.cs b/Code/Epic.Query/Relational/Scalar.cs index 52c50fef..a3ffe88f 100644 --- a/Code/Epic.Query/Relational/Scalar.cs +++ b/Code/Epic.Query/Relational/Scalar.cs @@ -34,7 +34,7 @@ public abstract class Scalar: VisitableBase, IEquatable private readonly ScalarType _type; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The scalar Name. @@ -64,14 +64,14 @@ public override bool Equals (object obj) #region IEquatable[Scalar] implementation /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals (Scalar other); #endregion diff --git a/Code/Epic.Query/Relational/ScalarFunction.cs b/Code/Epic.Query/Relational/ScalarFunction.cs index 814ab459..af0ed8f0 100644 --- a/Code/Epic.Query/Relational/ScalarFunction.cs +++ b/Code/Epic.Query/Relational/ScalarFunction.cs @@ -36,7 +36,7 @@ public abstract class ScalarFunction: Scalar, IEquatable { private readonly string _name; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Name. @@ -60,7 +60,7 @@ public ScalarFunction (string name): base(ScalarType.Function) public string Name { get { return this._name; } } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a @@ -70,14 +70,14 @@ public ScalarFunction (string name): base(ScalarType.Function) #region implemented abstract members of Epic.Linq.Expressions.Relational.Scalar /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Scalar other) { @@ -87,14 +87,14 @@ public override bool Equals (Scalar other) #region IEquatable[ScalarFunction] implementation /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals (ScalarFunction other); #endregion diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Expressions/Normalization/QueryableConstantResolverQA.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/Expressions/Normalization/QueryableConstantResolverQA.cs index 85091f1e..717d9b2e 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Expressions/Normalization/QueryableConstantResolverQA.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Expressions/Normalization/QueryableConstantResolverQA.cs @@ -80,7 +80,7 @@ public void Visit_aQueryProducedByADifferentQueryProvider_returnsANewConstantCon queryable.Expect(q => q.ElementType).Return(typeof(ICargo)).Repeat.Once(); ConstantExpression expressionToVisit = Expression.Constant(queryable); FakeNormalizer normalizer = new FakeNormalizer(); - QueryableConstantResolver visitor = new QueryableConstantResolver(normalizer); + new QueryableConstantResolver(normalizer); // act: Expression result = normalizer.Visit(expressionToVisit, context); @@ -102,7 +102,7 @@ public void Visit_aRepositoryInAConstantExpression_returnTheConstantItself() queryable.Expect(q => q.Expression).Return(Expression.Constant(queryable)).Repeat.Once(); ConstantExpression expressionToVisit = Expression.Constant(queryable); FakeNormalizer normalizer = new FakeNormalizer(); - QueryableConstantResolver visitor = new QueryableConstantResolver(normalizer); + new QueryableConstantResolver(normalizer); // act: Expression result = normalizer.Visit(expressionToVisit, context); @@ -125,7 +125,7 @@ public void Visit_aQueryableThatCanBeReplacedWithItsExpression_returnsTheExpress queryable.Expect(q => q.Expression).Return(dummyExpression).Repeat.Once(); ConstantExpression expressionToVisit = Expression.Constant(queryable); FakeNormalizer normalizer = new FakeNormalizer(); - QueryableConstantResolver visitor = new QueryableConstantResolver(normalizer); + new QueryableConstantResolver(normalizer); FakeVisitor mockVisitor = GeneratePartialMock>(normalizer); mockVisitor.Expect(v => v.CallAsVisitor(dummyExpression)).Return(mockVisitor).Repeat.Once(); mockVisitor.Expect(v => v.Visit(dummyExpression, context)).Return(expectedResult).Repeat.Once(); diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs index 40277ccd..4d96695d 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs @@ -33,7 +33,7 @@ public class DummyResultExpression : Expression { /// /// Initializes a new instance of the - /// class + /// class /// with ExpressionType equal to . /// public DummyResultExpression() diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs index fb89bb37..72ffef97 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs @@ -33,7 +33,7 @@ public sealed class UnknownExpression : Expression { /// /// Initializes a new instance of the - /// class + /// class /// with ExpressionType equal to . /// public UnknownExpression() From 11f969d5769c256f297af5b6d759d6d6ed4d17e6 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 10 Aug 2012 00:24:18 +0200 Subject: [PATCH 16/87] improved documentation and get rid of some warnings --- Code/Epic.Query/Epic.Query.csproj | 6 +- Code/Epic.Query/IEntityLoader.cs | 6 +- .../Relational/Operations/Projection.cs | 7 +-- .../Relational/Operations/Selection.cs | 4 +- .../Relational/Operations/ThetaJoin.cs | 20 +++---- Code/Epic.Query/Relational/Predicates/And.cs | 20 +++---- .../Predicates/BinaryPredicateBase.cs | 18 +++--- .../Epic.Query/Relational/Predicates/Equal.cs | 20 +++---- .../Relational/Predicates/Greater.cs | 8 +-- Code/Epic.Query/Relational/Predicates/Less.cs | 12 ++-- Code/Epic.Query/Relational/Predicates/Not.cs | 18 +++--- Code/Epic.Query/Relational/Predicates/Or.cs | 20 +++---- .../Relational/Predicates/Predicate.cs | 14 ++--- .../Predicates/PredicateExtension.cs | 60 +++++++++++++++++++ .../Predicates/ScalarPredicateBase.cs | 16 ++--- .../Predicates/UnaryPredicateBase.cs | 2 +- Code/Epic.Query/Relational/Predicates/Xor.cs | 14 ++--- Code/Epic.Query/Relational/Scalar.cs | 23 ++++++- .../Fakes/DummyResultExpression.cs | 14 ++++- .../Fakes/UnknownExpression.cs | 14 ++++- .../Epic.Query.Linq.UnitTests/ReflectionQA.cs | 2 +- 21 files changed, 209 insertions(+), 109 deletions(-) diff --git a/Code/Epic.Query/Epic.Query.csproj b/Code/Epic.Query/Epic.Query.csproj index ed4d916f..87ed1890 100644 --- a/Code/Epic.Query/Epic.Query.csproj +++ b/Code/Epic.Query/Epic.Query.csproj @@ -33,7 +33,7 @@ - + @@ -76,6 +76,10 @@ {05F67FFC-37A0-4CDC-BC67-E32CBFBE22A7} Epic.Prelude + + {A7F7A6D3-943F-480D-ADF2-7E846DD62D8C} + Epic.Core + diff --git a/Code/Epic.Query/IEntityLoader.cs b/Code/Epic.Query/IEntityLoader.cs index 5a1de907..178a9179 100644 --- a/Code/Epic.Query/IEntityLoader.cs +++ b/Code/Epic.Query/IEntityLoader.cs @@ -30,7 +30,7 @@ namespace Epic.Query /// A loader for . /// /// Type of the entity that the loader can load. - /// Type used to identify each . + /// Type used to identify each . public interface IEntityLoader where TEntity : class where TIdentity : IEquatable @@ -39,9 +39,9 @@ public interface IEntityLoader /// Load the specified entities. /// /// - /// Identifiers of the to load. + /// Identifiers of the to load. /// - /// One or more can not be loaded. + /// One or more can not be loaded. IEnumerable Load(params TIdentity[] identities); } } diff --git a/Code/Epic.Query/Relational/Operations/Projection.cs b/Code/Epic.Query/Relational/Operations/Projection.cs index dca176d0..392fccf6 100644 --- a/Code/Epic.Query/Relational/Operations/Projection.cs +++ b/Code/Epic.Query/Relational/Operations/Projection.cs @@ -46,7 +46,7 @@ public sealed class Projection: Relation, IEquatable /// The used as source for the projection. /// /// - /// The collection of extracted + /// The collection of relation attributes extracted /// /// /// A user-defined name used to identify the Projection relation. @@ -67,7 +67,7 @@ public Projection (Relation relation, IEnumerable attributes, /// The used as source for the projection. /// /// - /// The collection of extracted + /// The collection of relation attributes extracted /// public Projection(Relation relation, IEnumerable attributes): base(RelationType.Projection, getDefaultName(relation)) @@ -168,9 +168,6 @@ public override int GetHashCode () /// /// the used as source for the projection. /// - /// - /// The attributes to be extracted from the relation. - /// private static string getDefaultName (Relation relation) { if (null == relation) throw new ArgumentNullException("relation"); diff --git a/Code/Epic.Query/Relational/Operations/Selection.cs b/Code/Epic.Query/Relational/Operations/Selection.cs index d146ebae..0dd0bd14 100644 --- a/Code/Epic.Query/Relational/Operations/Selection.cs +++ b/Code/Epic.Query/Relational/Operations/Selection.cs @@ -162,9 +162,7 @@ public override TResult Accept (IVisitor visitor, IVisitContex /// /// The used as source for the selection. /// - /// - /// The condition against which the records are matched. - /// + /// is null. private static string getDefaultName(Relation relation) { if (null == relation) throw new ArgumentNullException("relation"); diff --git a/Code/Epic.Query/Relational/Operations/ThetaJoin.cs b/Code/Epic.Query/Relational/Operations/ThetaJoin.cs index b2dbbb4e..783d84a3 100644 --- a/Code/Epic.Query/Relational/Operations/ThetaJoin.cs +++ b/Code/Epic.Query/Relational/Operations/ThetaJoin.cs @@ -39,7 +39,7 @@ public sealed class ThetaJoin: Relation, IEquatable private readonly Predicate _predicate; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left relation in the Join operation. @@ -94,14 +94,14 @@ public ThetaJoin (Relation leftRelation, Relation rightRelation, Predicate predi public Predicate Predicate { get { return this._predicate; } } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Relation other) { @@ -109,15 +109,15 @@ public override bool Equals (Relation other) } /// - /// Determines whether the specified is equal to the - /// current . + /// Determines whether the specified is equal to the + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the - /// current ; otherwise, false. + /// true if the specified is equal to the + /// current ; otherwise, false. /// public bool Equals (ThetaJoin other) { @@ -130,7 +130,7 @@ public bool Equals (ThetaJoin other) } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/And.cs b/Code/Epic.Query/Relational/Predicates/And.cs index f28d0d46..bb8fb2fc 100644 --- a/Code/Epic.Query/Relational/Predicates/And.cs +++ b/Code/Epic.Query/Relational/Predicates/And.cs @@ -33,7 +33,7 @@ public sealed class And : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -47,15 +47,15 @@ public And (Predicate leftOperand, Predicate rightOperand) } /// - /// Determines whether the specified is equal to the - /// current . + /// Determines whether the specified is equal to the + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the - /// current ; otherwise, false. + /// true if the specified is equal to the + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals (And other) { diff --git a/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs index e75863d4..590dd924 100644 --- a/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/BinaryPredicateBase.cs @@ -37,7 +37,7 @@ public abstract class BinaryPredicateBase : Predicate, IEquatable /// Initializes a new instance of the - /// class. + /// class. /// /// /// Left operand of the predicate. Cannot be . @@ -73,26 +73,26 @@ protected BinaryPredicateBase (Predicate leftOperand, Predicate rightOperand) public Predicate Right { get { return this._right; } } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the - /// current ; otherwise, false. + /// true if the specified is equal to the + /// current ; otherwise, false. /// public abstract bool Equals(BinaryPredicateBase other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Predicate other) { @@ -101,7 +101,7 @@ public override bool Equals (Predicate other) /// /// Serves as a hash function for a - /// object. + /// object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/Equal.cs b/Code/Epic.Query/Relational/Predicates/Equal.cs index e0fbc5d9..b37c37c2 100644 --- a/Code/Epic.Query/Relational/Predicates/Equal.cs +++ b/Code/Epic.Query/Relational/Predicates/Equal.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Equal : ScalarPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -47,15 +47,15 @@ public Equal (Scalar leftOperand, Scalar rightOperand) } /// - /// Determines whether the specified is equal to the - /// current . + /// Determines whether the specified is equal to the + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public override bool Equals (ScalarPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals(Equal other) { diff --git a/Code/Epic.Query/Relational/Predicates/Greater.cs b/Code/Epic.Query/Relational/Predicates/Greater.cs index cc60c273..15ec41da 100644 --- a/Code/Epic.Query/Relational/Predicates/Greater.cs +++ b/Code/Epic.Query/Relational/Predicates/Greater.cs @@ -61,14 +61,14 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals(Greater other) { diff --git a/Code/Epic.Query/Relational/Predicates/Less.cs b/Code/Epic.Query/Relational/Predicates/Less.cs index a08944f6..49eee3a0 100644 --- a/Code/Epic.Query/Relational/Predicates/Less.cs +++ b/Code/Epic.Query/Relational/Predicates/Less.cs @@ -47,14 +47,14 @@ public Less (Scalar leftOperand, Scalar rightOperand) } /// - /// Determines whether the specified is equal to the + /// Determines whether the specified is equal to the /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current + /// true if the specified is equal to the current /// ; otherwise, false. /// public override bool Equals (ScalarPredicateBase other) @@ -63,13 +63,13 @@ public override bool Equals (ScalarPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current + /// true if the specified is equal to the current /// ; otherwise, false. /// public bool Equals(Less other) diff --git a/Code/Epic.Query/Relational/Predicates/Not.cs b/Code/Epic.Query/Relational/Predicates/Not.cs index 7728d01c..f4b36c19 100644 --- a/Code/Epic.Query/Relational/Predicates/Not.cs +++ b/Code/Epic.Query/Relational/Predicates/Not.cs @@ -32,7 +32,7 @@ namespace Epic.Query.Relational.Predicates public sealed class Not : UnaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Operand. @@ -42,14 +42,14 @@ public Not (Predicate operand): base(operand) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public override bool Equals (UnaryPredicateBase other) { @@ -57,14 +57,14 @@ public override bool Equals (UnaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals(Not other) { diff --git a/Code/Epic.Query/Relational/Predicates/Or.cs b/Code/Epic.Query/Relational/Predicates/Or.cs index 04ef09a7..96c1c9af 100644 --- a/Code/Epic.Query/Relational/Predicates/Or.cs +++ b/Code/Epic.Query/Relational/Predicates/Or.cs @@ -33,7 +33,7 @@ public sealed class Or : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -47,15 +47,15 @@ public Or (Predicate leftOperand, Predicate rightOperand) } /// - /// Determines whether the specified is equal to the - /// current . + /// Determines whether the specified is equal to the + /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the - /// current ; otherwise, false. + /// true if the specified is equal to the + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals (Or other) { diff --git a/Code/Epic.Query/Relational/Predicates/Predicate.cs b/Code/Epic.Query/Relational/Predicates/Predicate.cs index e7d599bc..f57954eb 100644 --- a/Code/Epic.Query/Relational/Predicates/Predicate.cs +++ b/Code/Epic.Query/Relational/Predicates/Predicate.cs @@ -33,34 +33,34 @@ public abstract class Predicate : VisitableBase, IEquatable { #region IEquatable[Predicate] implementation /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public abstract bool Equals (Predicate other); #endregion /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (object obj) { return Equals (obj as Predicate); } /// - /// Serves as a hash function for a object. + /// Serves as a hash function for a object. /// /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a diff --git a/Code/Epic.Query/Relational/Predicates/PredicateExtension.cs b/Code/Epic.Query/Relational/Predicates/PredicateExtension.cs index 7ef59da4..7ace0636 100644 --- a/Code/Epic.Query/Relational/Predicates/PredicateExtension.cs +++ b/Code/Epic.Query/Relational/Predicates/PredicateExtension.cs @@ -25,33 +25,93 @@ namespace Epic.Query.Relational.Predicates { + /// + /// Extension methods for (and its specializations). + /// public static class PredicateExtension { + /// + /// Negate the specified predicate. + /// + /// + /// Predicate. + /// + /// is public static Not Not(this Predicate predicate) { return new Not(predicate); } + /// + /// Conjunges logically the specified predicate and other. + /// + /// + /// Predicate. + /// + /// + /// Other. + /// + /// or is public static And And(this Predicate predicate, Predicate other) { return new And(predicate, other); } + /// + /// Disjunge logically the specified predicate and other. + /// + /// + /// Predicate. + /// + /// + /// Other. + /// + /// or is public static Or Or(this Predicate predicate, Predicate other) { return new Or(predicate, other); } + /// + /// Produce an predicate for the specified scalar and other. + /// + /// + /// A scalar. + /// + /// + /// Another scalar. + /// + /// or is public static Equal Equal(this Scalar scalar, Scalar other) { return new Equal(scalar, other); } + /// + /// Produce an predicate for the specified scalar and other. + /// + /// + /// Scalar. + /// + /// + /// Other. + /// + /// or is public static Greater Greater(this Scalar scalar, Scalar other) { return new Greater(scalar, other); } + /// + /// Produce an predicate for the specified scalar and other. + /// + /// + /// Scalar. + /// + /// + /// Other. + /// + /// or is public static Less Less(this Scalar scalar, Scalar other) { return new Less(scalar, other); diff --git a/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs index 132f5102..a5741413 100644 --- a/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/ScalarPredicateBase.cs @@ -27,7 +27,7 @@ namespace Epic.Query.Relational.Predicates { /// /// This is the base class for those predicates having two as operands. - /// Examples are: , , . + /// Examples are: , , . /// [Serializable] public abstract class ScalarPredicateBase : Predicate, IEquatable @@ -73,26 +73,26 @@ internal protected ScalarPredicateBase (Scalar leftOperand, Scalar rightOperand) public Scalar Right { get { return this._right; } } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public abstract bool Equals(ScalarPredicateBase other); /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the current - /// ; otherwise, false. + /// ; otherwise, false. /// public override bool Equals (Predicate other) { diff --git a/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs b/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs index b3e80db7..78cb0297 100644 --- a/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs +++ b/Code/Epic.Query/Relational/Predicates/UnaryPredicateBase.cs @@ -39,7 +39,7 @@ public abstract class UnaryPredicateBase : Predicate, IEquatable class. /// /// - /// The operand of the predicate. Cannot be . /// /// /// This exception is thrown if any of the operand is diff --git a/Code/Epic.Query/Relational/Predicates/Xor.cs b/Code/Epic.Query/Relational/Predicates/Xor.cs index 5e1fe55e..cd8c88c9 100644 --- a/Code/Epic.Query/Relational/Predicates/Xor.cs +++ b/Code/Epic.Query/Relational/Predicates/Xor.cs @@ -33,7 +33,7 @@ public sealed class Xor : BinaryPredicateBase, IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Left operand. @@ -51,11 +51,11 @@ public Xor (Predicate leftOperand, Predicate rightOperand) /// current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// /// true if the specified is equal to the - /// current ; otherwise, false. + /// current ; otherwise, false. /// public override bool Equals (BinaryPredicateBase other) { @@ -63,14 +63,14 @@ public override bool Equals (BinaryPredicateBase other) } /// - /// Determines whether the specified is equal to the current . + /// Determines whether the specified is equal to the current . /// /// - /// The to compare with the current . + /// The to compare with the current . /// /// - /// true if the specified is equal to the current - /// ; otherwise, false. + /// true if the specified is equal to the current + /// ; otherwise, false. /// public bool Equals (Xor other) { diff --git a/Code/Epic.Query/Relational/Scalar.cs b/Code/Epic.Query/Relational/Scalar.cs index a3ffe88f..7f1864cb 100644 --- a/Code/Epic.Query/Relational/Scalar.cs +++ b/Code/Epic.Query/Relational/Scalar.cs @@ -36,9 +36,6 @@ public abstract class Scalar: VisitableBase, IEquatable /// /// Initializes a new instance of the class. /// - /// - /// The scalar Name. - /// /// /// The scalar . /// @@ -55,8 +52,28 @@ internal Scalar (ScalarType type) /// public ScalarType Type { get { return this._type; } } + /// + /// Serves as a hash function for a object. + /// + /// + /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a + /// hash table. + /// public abstract override int GetHashCode (); + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// This method delegate the equality check to the abstract overload . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public override bool Equals (object obj) { return Equals (obj as Scalar); diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs index 4d96695d..632e8c7c 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/DummyResultExpression.cs @@ -37,9 +37,21 @@ public class DummyResultExpression : Expression /// with ExpressionType equal to . /// public DummyResultExpression() - : base((ExpressionType)int.MinValue, typeof(string)) + : base() { } + + public override ExpressionType NodeType { + get { + return (ExpressionType)int.MinValue; + } + } + + public override System.Type Type { + get { + return typeof(string); + } + } } } diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs index 72ffef97..1a720fdb 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/Fakes/UnknownExpression.cs @@ -37,9 +37,21 @@ public sealed class UnknownExpression : Expression /// with ExpressionType equal to . /// public UnknownExpression() - : base((ExpressionType)int.MaxValue, typeof(string)) + : base() { } + + public override ExpressionType NodeType { + get { + return (ExpressionType)int.MaxValue; + } + } + + public override System.Type Type { + get { + return typeof(string); + } + } } } diff --git a/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs b/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs index 7ec955cf..e725bdab 100644 --- a/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs +++ b/Code/UnitTests/Epic.Query.Linq.UnitTests/ReflectionQA.cs @@ -41,7 +41,7 @@ public interface IClosedTestEnumerable : ITestEnumerable public sealed class DummyClassWithDifferentMembers { - public DummyClassWithDifferentMembers() { this.SampleEvent += delegate { }; } + public DummyClassWithDifferentMembers() { this.SampleEvent += delegate { }; SampleEvent(this, null);} public int IntProperty { get; set; } public string StringProperty { get; set; } public int IntField = 0; From 343583b450b1078a1d21e1cbb4976c8e60f37dfe Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 10 Aug 2012 01:26:22 +0200 Subject: [PATCH 17/87] improved documentation --- Code/Epic.Query.Object/OrderCriterion.cs | 66 ++++++++++++++++++++ Code/Epic.Query.Object/OrderCriterionBase.cs | 58 +++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/Code/Epic.Query.Object/OrderCriterion.cs b/Code/Epic.Query.Object/OrderCriterion.cs index 198ee805..da6425f9 100644 --- a/Code/Epic.Query.Object/OrderCriterion.cs +++ b/Code/Epic.Query.Object/OrderCriterion.cs @@ -68,14 +68,50 @@ internal OrderCriterion () #region IComparer implementation + /// + /// Compare the specified x and y. + /// + /// + /// The x entity. + /// + /// + /// The y entity. + /// public abstract int Compare (TEntity x, TEntity y); #endregion #region IEquatable implementation + /// + /// Determines whether the specified is equal to the + /// current , given that + /// grant that it is not , and that it has the same type of the current instance. + /// + /// + /// true, if equals was safed, false otherwise. + /// + /// + /// Other. + /// protected abstract bool SafeEquals(OrderCriterion other); + /// + /// Determines whether the specified is equal to the + /// current . + /// + /// + /// This is a template method thet test for reference equality with + /// and and than for type equality (). + /// If both tests fails, it delegates to the abstract method the equality determination. + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public bool Equals (OrderCriterion other) { if(null == other) @@ -87,11 +123,32 @@ public bool Equals (OrderCriterion other) return SafeEquals(other); } + /// + /// Determines whether the specified is equal to the current + /// . + /// + /// + /// Delegates the evaluation to . + /// + /// + /// The to compare with the current . + /// + /// + /// true if the specified is equal to the current + /// ; otherwise, false. + /// public sealed override bool Equals (object obj) { return Equals (obj as OrderCriterion); } + /// + /// Serves as a hash function for a object. + /// + /// + /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a + /// hash table. + /// public sealed override int GetHashCode () { return GetType().GetHashCode (); @@ -108,6 +165,15 @@ internal OrderCriterion(SerializationInfo info, StreamingContext context) throw new ArgumentNullException("info"); } + /// + /// Gets the object data to be serialized. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected abstract void GetObjectData (SerializationInfo info, StreamingContext context); void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) diff --git a/Code/Epic.Query.Object/OrderCriterionBase.cs b/Code/Epic.Query.Object/OrderCriterionBase.cs index 2c47ff70..6bd252b7 100644 --- a/Code/Epic.Query.Object/OrderCriterionBase.cs +++ b/Code/Epic.Query.Object/OrderCriterionBase.cs @@ -56,6 +56,17 @@ protected OrderCriterionBase () } } + /// + /// Determines whether the specified is equal to the + /// current , given that + /// grant that it is not , and that it has the same type of the current instance. + /// + /// + /// true, if equals was safed, false otherwise. + /// + /// + /// Other. + /// protected override sealed bool SafeEquals (OrderCriterion other) { TOrderCriterion otherCriterion = other as TOrderCriterion; @@ -65,23 +76,70 @@ protected override sealed bool SafeEquals (OrderCriterion other) return SafeEquals(otherCriterion); } + /// + /// Determines whether the specified is equal to the + /// current , given that + /// grant that it is not , and that it has the same type of the current instance. + /// + /// + /// true, if equals was safed, false otherwise. + /// + /// + /// Other. + /// protected abstract bool SafeEquals (TOrderCriterion other); + /// + /// Accept the specified visitor and context as a . + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// Type of the result of the visit. + /// public sealed override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe(this as TOrderCriterion, visitor, context); } + /// + /// Chain the specified to compare + /// when they are equivalent according to the current criterion. + /// + /// + /// Other order criterion to evaluate after the current one. + /// public override sealed OrderCriterion Chain(OrderCriterion other) { return new OrderCriteria(this, other); } + /// + /// Reverse this order criterion. + /// + /// + /// A criterion that is the reverse of this. + /// + /// public override sealed OrderCriterion Reverse() { return new ReverseOrder(this); } + /// + /// Initializes a new instance of the class, + /// after deserialization. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected OrderCriterionBase(SerializationInfo info, StreamingContext context) : base(info, context) { From 7422c3d9cd2d9c3222ca382f4e3a02d4d5d55e9f Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 10 Aug 2012 19:35:20 +0200 Subject: [PATCH 18/87] some more doc --- .../Specifications/Disjunction.cs | 4 ++++ Code/Epic.Prelude/Specifications/Negation.cs | 23 +++++++++++++++++++ Code/Epic.Prelude/Specifications/No.cs | 18 +++++++++++++++ .../Specifications/SpecificationBase.cs | 4 ++-- .../StatelessSpecificationBase.cs | 14 ++++++++++- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/Code/Epic.Prelude/Specifications/Disjunction.cs b/Code/Epic.Prelude/Specifications/Disjunction.cs index 310d6ecc..41ac542d 100644 --- a/Code/Epic.Prelude/Specifications/Disjunction.cs +++ b/Code/Epic.Prelude/Specifications/Disjunction.cs @@ -38,6 +38,10 @@ public sealed class Disjunction : SpecificationBase[] _specifications; + + /// + /// Initialize a new . + /// public Disjunction(ISpecification first, ISpecification second) { if (null == first) diff --git a/Code/Epic.Prelude/Specifications/Negation.cs b/Code/Epic.Prelude/Specifications/Negation.cs index a5971b75..24337dd5 100644 --- a/Code/Epic.Prelude/Specifications/Negation.cs +++ b/Code/Epic.Prelude/Specifications/Negation.cs @@ -35,6 +35,11 @@ public sealed class Negation : SpecificationBase _negated; + /// + /// Initialize a new that is satisfied by any + /// that does not satisfy . + /// + /// Specification to negate. public Negation (ISpecification specification) { if(null == specification) @@ -42,6 +47,9 @@ public Negation (ISpecification specification) _negated = specification; } + /// + /// Negated specification. + /// public ISpecification Negated { get @@ -51,16 +59,31 @@ public ISpecification Negated } #region implemented abstract members of Epic.Specifications.SpecificationBase + /// + /// Determine whether the current negates the same + /// that negates. + /// + /// + /// protected override bool EqualsA (Negation otherSpecification) { return _negated.Equals(otherSpecification._negated); } + /// + /// Returns if does not satisfy . + /// + /// A candidate. + /// if does not satisfy , otherwise. protected override bool IsSatisfiedByA (TCandidate candidate) { return !_negated.IsSatisfiedBy(candidate); } + /// + /// Set in . + /// + /// The negation of the current specification. protected override void BuildNegation (out ISpecification negation) { negation = _negated; diff --git a/Code/Epic.Prelude/Specifications/No.cs b/Code/Epic.Prelude/Specifications/No.cs index 02382bb1..028852fb 100644 --- a/Code/Epic.Prelude/Specifications/No.cs +++ b/Code/Epic.Prelude/Specifications/No.cs @@ -48,11 +48,29 @@ private No () #region implemented abstract members of Epic.Specifications.SpecificationBase + /// + /// Determines that this specification cannot be satisfied by any candidate. + /// + /// + /// Always false. + /// + /// + /// Candidate. + /// protected override bool IsSatisfiedByA (TCandidate candidate) { return false; } + /// + /// Ands the also. + /// + /// + /// The also. + /// + /// + /// Other. + /// protected override ISpecification AndAlso (ISpecification other) { return this; diff --git a/Code/Epic.Prelude/Specifications/SpecificationBase.cs b/Code/Epic.Prelude/Specifications/SpecificationBase.cs index 4951308a..4f48ad6f 100644 --- a/Code/Epic.Prelude/Specifications/SpecificationBase.cs +++ b/Code/Epic.Prelude/Specifications/SpecificationBase.cs @@ -314,7 +314,7 @@ protected virtual void BuildNegation (out ISpecification negatedSpeci } /// - /// Create a new that is satisfied by all the + /// Create a new that is satisfied by all the /// that are and satisfy the current specification. /// /// @@ -341,7 +341,7 @@ public ISpecification OfType () where Other : class /// /// /// A specifications satisfied by that - /// satisfy this specification (if not overridden, an ). + /// satisfy this specification (if not overridden, an ). /// /// /// Either a specialization or an abstraction of . diff --git a/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs b/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs index 7238b8d2..74ab7b4b 100644 --- a/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs +++ b/Code/Epic.Prelude/Specifications/StatelessSpecificationBase.cs @@ -35,10 +35,22 @@ public abstract class StatelessSpecificationBase : S where TCandidate : class where TSpecification : class, ISpecification, IEquatable { + /// + /// Initializes a new instance of the class. + /// protected StatelessSpecificationBase () { } - + + /// + /// Returns true for any , since its has to be stateless. + /// + /// + /// Always true. + /// + /// + /// Other specification. + /// protected override sealed bool EqualsA (TSpecification otherSpecification) { return true; From 344fe6c4941bfb6f14be40e0a78612703e8b0bb4 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Sat, 11 Aug 2012 01:41:28 +0200 Subject: [PATCH 19/87] some more documentation --- .../Specifications/Conjunction.cs | 44 +++++++++++++++++++ .../Specifications/Disjunction.cs | 31 +++++++++++++ Code/Epic.Prelude/Specifications/No.cs | 21 +++++++-- .../Specifications/SpecificationBase.cs | 2 +- Code/Epic.Query.Object/Expressions/Count.cs | 9 ++++ Code/Epic.Query.Object/IDeferred.cs | 4 +- Code/Epic.Query.Object/Searchable.cs | 8 ++-- 7 files changed, 109 insertions(+), 10 deletions(-) diff --git a/Code/Epic.Prelude/Specifications/Conjunction.cs b/Code/Epic.Prelude/Specifications/Conjunction.cs index 245e724e..d37ad9f8 100644 --- a/Code/Epic.Prelude/Specifications/Conjunction.cs +++ b/Code/Epic.Prelude/Specifications/Conjunction.cs @@ -38,6 +38,20 @@ public sealed class Conjunction : SpecificationBase[] _specifications; + + /// + /// Initializes a new instance of the class. + /// + /// + /// First specification. + /// + /// + /// Second specification. + /// + /// or + /// are . + /// and + /// are equal. public Conjunction(ISpecification first, ISpecification second) { if (null == first) @@ -98,6 +112,16 @@ public Conjunction(ISpecification first, ISpecification #region implemented abstract members of Epic.Specifications.SpecificationBase + /// + /// Returns a new that will be satisfied when both + /// the current specification and the are satisfied. + /// + /// + /// A . + /// + /// + /// Another specification. + /// protected override ISpecification AndAlso (ISpecification other) { Conjunction otherAnd = other as Conjunction; @@ -112,6 +136,17 @@ protected override ISpecification AndAlso (ISpecification + /// Determine whether the current is equal + /// to . + /// + /// + /// true, if each of disjuncted specification are equal + /// to the corresponding one in , false otherwise. + /// + /// + /// Another specification. + /// protected override bool EqualsA (Conjunction otherSpecification) { if(_specifications.Length != otherSpecification._specifications.Length) @@ -122,6 +157,15 @@ protected override bool EqualsA (Conjunction otherSpecification) return true; } + /// + /// Determines whether this specification is satisfied by . + /// + /// + /// true if satisfies all the conjuncted specifications; otherwise, false. + /// + /// + /// Candidate. + /// protected override bool IsSatisfiedByA (TCandidate candidate) { for(int i = 0; i < _specifications.Length; ++i) diff --git a/Code/Epic.Prelude/Specifications/Disjunction.cs b/Code/Epic.Prelude/Specifications/Disjunction.cs index 41ac542d..4137a164 100644 --- a/Code/Epic.Prelude/Specifications/Disjunction.cs +++ b/Code/Epic.Prelude/Specifications/Disjunction.cs @@ -102,6 +102,16 @@ public Disjunction(ISpecification first, ISpecification #region implemented abstract members of Epic.Specifications.SpecificationBase + /// + /// Returns a new that will be satisfied when either + /// the current specification or the are satisfied. + /// + /// + /// A . + /// + /// + /// Another specification. + /// protected override ISpecification OrElse (ISpecification other) { Disjunction otherOr = other as Disjunction; @@ -116,6 +126,17 @@ protected override ISpecification OrElse (ISpecification return base.OrElse (other); } + /// + /// Determine whether the current is equal + /// to . + /// + /// + /// true, if each of disjuncted specification are equal + /// to the corresponding one in , false otherwise. + /// + /// + /// Another specification. + /// protected override bool EqualsA (Disjunction otherSpecification) { if(_specifications.Length != otherSpecification._specifications.Length) @@ -126,6 +147,16 @@ protected override bool EqualsA (Disjunction otherSpecification) return true; } + /// + /// Determines whether this specification is satisfied by . + /// + /// + /// true if satisfies at least one of + /// the disjuncted specifications; otherwise, false. + /// + /// + /// Candidate. + /// protected override bool IsSatisfiedByA (TCandidate candidate) { for(int i = 0; i < _specifications.Length; ++i) diff --git a/Code/Epic.Prelude/Specifications/No.cs b/Code/Epic.Prelude/Specifications/No.cs index 028852fb..743dedf5 100644 --- a/Code/Epic.Prelude/Specifications/No.cs +++ b/Code/Epic.Prelude/Specifications/No.cs @@ -63,24 +63,39 @@ protected override bool IsSatisfiedByA (TCandidate candidate) } /// - /// Ands the also. + /// Returns the , since False AND P = False. /// /// - /// The also. + /// The current instance. /// /// - /// Other. + /// Another that will be ignored. /// protected override ISpecification AndAlso (ISpecification other) { return this; } + /// + /// Returns the , since False OR P = P. + /// + /// + /// The . + /// + /// + /// Another specification. + /// protected override ISpecification OrElse (ISpecification other) { return other; } + /// + /// Returns in a . + /// + /// + /// An . since NOT False == True. + /// protected override void BuildNegation (out ISpecification negation) { negation = Any.Specification; diff --git a/Code/Epic.Prelude/Specifications/SpecificationBase.cs b/Code/Epic.Prelude/Specifications/SpecificationBase.cs index 4f48ad6f..b47d4e8c 100644 --- a/Code/Epic.Prelude/Specifications/SpecificationBase.cs +++ b/Code/Epic.Prelude/Specifications/SpecificationBase.cs @@ -551,7 +551,7 @@ protected virtual ISpecification OrElse (ISpecification { return new Disjunction (this, other); } - + ISpecification ISpecification.Negate () { ISpecification result = null; diff --git a/Code/Epic.Query.Object/Expressions/Count.cs b/Code/Epic.Query.Object/Expressions/Count.cs index 11a5d257..073a1215 100644 --- a/Code/Epic.Query.Object/Expressions/Count.cs +++ b/Code/Epic.Query.Object/Expressions/Count.cs @@ -73,6 +73,15 @@ private Count(SerializationInfo info, StreamingContext context) _source = (Expression>)info.GetValue("S", typeof(Expression>)); } + /// + /// Gets the object data for serialization. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue("S", _source, typeof(Expression>)); diff --git a/Code/Epic.Query.Object/IDeferred.cs b/Code/Epic.Query.Object/IDeferred.cs index 2cad2341..05707e70 100644 --- a/Code/Epic.Query.Object/IDeferred.cs +++ b/Code/Epic.Query.Object/IDeferred.cs @@ -49,12 +49,12 @@ namespace Epic.Query.Object /// (like , /// and /// ) using specialized - /// for their specific purposes. + /// for their specific purposes. /// /// /// The can be evaluated when /// the is actually needed, through - /// the method. + /// the method. /// /// public interface IDeferred diff --git a/Code/Epic.Query.Object/Searchable.cs b/Code/Epic.Query.Object/Searchable.cs index 081c0c3a..08ff92e2 100644 --- a/Code/Epic.Query.Object/Searchable.cs +++ b/Code/Epic.Query.Object/Searchable.cs @@ -51,18 +51,18 @@ namespace Epic.Query.Object /// Instead, their functionality is to build an /// object, which is an expression tree that /// represents the cumulative request. The methods then pass the new expression - /// tree to either the method or the + /// tree to either the method or the /// method of the input /// . /// The method that is called depends on whether the /// method returns an actual value, in which case - /// is called, or has deferred results, + /// is called, or has deferred results, /// in which case is called. /// /// /// The actual query execution on the target data is performed when the actual value - /// is needed. For example - /// actually execute the count and + /// is needed. For example + /// actually execute the count and /// retrieves and returns the identities of the required entities. /// /// From fba5125da053825a876324375e64a99e30bd50a9 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Sun, 12 Aug 2012 11:13:20 +0200 Subject: [PATCH 20/87] improved doc --- Code/Epic.Query.Object/Deferrable.cs | 2 +- Code/Epic.Query.Object/DeferringException.cs | 4 +- Code/Epic.Query.Object/Expressions/Count.cs | 12 +++++ .../Expressions/Identification.cs | 21 ++++++++ Code/Epic.Query.Object/Expressions/Order.cs | 21 ++++++++ .../Expressions/Selection.cs | 23 +++++++- Code/Epic.Query.Object/Expressions/Slice.cs | 24 ++++++++- Code/Epic.Query.Object/Expressions/Source.cs | 23 +++++++- .../Expressions/SourceDowncast.cs | 23 +++++++- Code/Epic.Query.Object/IDeferred.cs | 2 +- Code/Epic.Query.Object/OrderCriteria.cs | 52 +++++++++++++++++++ Code/Epic.Query.Object/OrderCriterion.cs | 4 +- Code/Epic.Query.Object/ReverseOrder.cs | 27 ++++++++++ Code/Epic.Query.Object/Searchable.cs | 4 +- Tools/NantScripts/RunNUnit.include | 4 +- 15 files changed, 231 insertions(+), 15 deletions(-) diff --git a/Code/Epic.Query.Object/Deferrable.cs b/Code/Epic.Query.Object/Deferrable.cs index ca440aa9..bcd4c6dc 100644 --- a/Code/Epic.Query.Object/Deferrable.cs +++ b/Code/Epic.Query.Object/Deferrable.cs @@ -38,7 +38,7 @@ public static class Deferrable /// /// A deferred . /// - /// + /// /// The type of the results. /// /// diff --git a/Code/Epic.Query.Object/DeferringException.cs b/Code/Epic.Query.Object/DeferringException.cs index aaa8157c..5ac083e0 100644 --- a/Code/Epic.Query.Object/DeferringException.cs +++ b/Code/Epic.Query.Object/DeferringException.cs @@ -56,7 +56,7 @@ internal DeferringException(string message) /// /// /// The exception that is the cause of the current exception. - /// If the parameter is not a null reference, the current + /// If the parameter is not a null reference, the current /// exception is raised in a catch block that handles the inner exception. /// internal DeferringException(string message, Exception inner) @@ -116,7 +116,7 @@ public DeferringException(string message) /// /// /// The exception that is the cause of the current exception. - /// If the parameter is not a null reference, the current + /// If the parameter is not a null reference, the current /// exception is raised in a catch block that handles the inner exception. /// public DeferringException(string message, Exception inner) diff --git a/Code/Epic.Query.Object/Expressions/Count.cs b/Code/Epic.Query.Object/Expressions/Count.cs index 073a1215..52b36352 100644 --- a/Code/Epic.Query.Object/Expressions/Count.cs +++ b/Code/Epic.Query.Object/Expressions/Count.cs @@ -62,6 +62,18 @@ public Expression> Source } } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe(this, visitor, context); diff --git a/Code/Epic.Query.Object/Expressions/Identification.cs b/Code/Epic.Query.Object/Expressions/Identification.cs index 5bbe43a5..63d2a9bc 100644 --- a/Code/Epic.Query.Object/Expressions/Identification.cs +++ b/Code/Epic.Query.Object/Expressions/Identification.cs @@ -63,11 +63,32 @@ public Expression> Entities { } } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("E", _entities, typeof(Expression>)); diff --git a/Code/Epic.Query.Object/Expressions/Order.cs b/Code/Epic.Query.Object/Expressions/Order.cs index 19ba43c7..055e1cd8 100644 --- a/Code/Epic.Query.Object/Expressions/Order.cs +++ b/Code/Epic.Query.Object/Expressions/Order.cs @@ -90,11 +90,32 @@ public OrderCriterion Criterion { get { return _criterion; } } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("R", _source, typeof(Expression>)); diff --git a/Code/Epic.Query.Object/Expressions/Selection.cs b/Code/Epic.Query.Object/Expressions/Selection.cs index c962357d..8d49f890 100644 --- a/Code/Epic.Query.Object/Expressions/Selection.cs +++ b/Code/Epic.Query.Object/Expressions/Selection.cs @@ -49,7 +49,7 @@ public sealed class Selection : Expression> /// /// Specification to satisfy. /// - /// or is null + /// or is . public Selection (Expression> source, ISpecification specification) { if (null == source) @@ -74,11 +74,32 @@ public ISpecification Specification { get { return _specification;} } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("R", _source, typeof(Expression>)); diff --git a/Code/Epic.Query.Object/Expressions/Slice.cs b/Code/Epic.Query.Object/Expressions/Slice.cs index 7bf11e9d..fe893878 100644 --- a/Code/Epic.Query.Object/Expressions/Slice.cs +++ b/Code/Epic.Query.Object/Expressions/Slice.cs @@ -66,8 +66,7 @@ public Slice (Order source, uint toTake) /// Number of to bypass. /// /// is null. - /// is - /// or is 0. + /// is . public Slice (uint toSkip, Order source) : this(source, toSkip, uint.MaxValue) { @@ -122,11 +121,32 @@ public uint Skipping { get { return _toSkip; } } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("S", _source, typeof(Order)); diff --git a/Code/Epic.Query.Object/Expressions/Source.cs b/Code/Epic.Query.Object/Expressions/Source.cs index bc67bcb7..3cf344ad 100644 --- a/Code/Epic.Query.Object/Expressions/Source.cs +++ b/Code/Epic.Query.Object/Expressions/Source.cs @@ -60,11 +60,32 @@ public IRepository Repository { get { return _repository; } } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } - + + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("R", _repository, typeof(IRepository)); diff --git a/Code/Epic.Query.Object/Expressions/SourceDowncast.cs b/Code/Epic.Query.Object/Expressions/SourceDowncast.cs index a1603605..357776b9 100644 --- a/Code/Epic.Query.Object/Expressions/SourceDowncast.cs +++ b/Code/Epic.Query.Object/Expressions/SourceDowncast.cs @@ -60,12 +60,33 @@ public SourceDowncast (Expression> source) public Expression> Source { get { return _source; } } - + + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe (this, visitor, context); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ( diff --git a/Code/Epic.Query.Object/IDeferred.cs b/Code/Epic.Query.Object/IDeferred.cs index 05707e70..5cf69b1c 100644 --- a/Code/Epic.Query.Object/IDeferred.cs +++ b/Code/Epic.Query.Object/IDeferred.cs @@ -38,7 +38,7 @@ namespace Epic.Query.Object /// been computed yet. Its /// declaratively describes the qualities of the /// . Such expression is defined by - /// the method of the + /// the method of the /// . /// /// diff --git a/Code/Epic.Query.Object/OrderCriteria.cs b/Code/Epic.Query.Object/OrderCriteria.cs index aa8ecba4..bbfb76d1 100644 --- a/Code/Epic.Query.Object/OrderCriteria.cs +++ b/Code/Epic.Query.Object/OrderCriteria.cs @@ -84,11 +84,27 @@ private OrderCriteria(OrderCriterion[] criteria) _criteria = criteria; } + /// + /// Chain the specified criterion after the current chain. + /// + /// + /// If is a set of , + /// the contained criteria are merged after those in the current instance. + /// + /// + /// Another order criterion. + /// public override OrderCriterion Chain (OrderCriterion other) { return new OrderCriteria(this, other); } + /// + /// Reverse this criterion producing a new set of . + /// + /// + /// A set of that is the reverse of this. + /// public override OrderCriterion Reverse () { OrderCriterion[] criteria = new OrderCriterion[_criteria.Length]; @@ -98,6 +114,18 @@ public override OrderCriterion Reverse () return new OrderCriteria(criteria); } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// public override TResult Accept (IVisitor visitor, IVisitContext context) { return AcceptMe(this, visitor, context); @@ -117,6 +145,15 @@ protected override bool SafeEquals (OrderCriterion other) #endregion #region implemented abstract members of Epic.Query.Object.OrderCriterion + /// + /// Compare the specified entities. + /// + /// + /// The first entity. + /// + /// + /// The second entity. + /// public override int Compare (TEntity x, TEntity y) { int comparison = 0; @@ -138,6 +175,12 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () #endregion #region IEnumerable implementation + /// + /// Gets the enumerator of contained criteria. + /// + /// + /// The enumerator of . + /// public IEnumerator> GetEnumerator () { return (_criteria as IEnumerable>).GetEnumerator(); @@ -152,6 +195,15 @@ private OrderCriteria(SerializationInfo info, StreamingContext context) _criteria = (OrderCriterion[])info.GetValue("C", typeof(OrderCriterion[])); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue("C", _criteria, typeof(OrderCriterion[])); diff --git a/Code/Epic.Query.Object/OrderCriterion.cs b/Code/Epic.Query.Object/OrderCriterion.cs index da6425f9..4eb723b7 100644 --- a/Code/Epic.Query.Object/OrderCriterion.cs +++ b/Code/Epic.Query.Object/OrderCriterion.cs @@ -86,7 +86,7 @@ internal OrderCriterion () /// /// Determines whether the specified is equal to the /// current , given that - /// grant that it is not , and that it has the same type of the current instance. + /// grant that it is not , and that it has the same type of the current instance. /// /// /// true, if equals was safed, false otherwise. @@ -128,7 +128,7 @@ public bool Equals (OrderCriterion other) /// . /// /// - /// Delegates the evaluation to . + /// Delegates the evaluation to . /// /// /// The to compare with the current . diff --git a/Code/Epic.Query.Object/ReverseOrder.cs b/Code/Epic.Query.Object/ReverseOrder.cs index 29497cca..c7947a08 100644 --- a/Code/Epic.Query.Object/ReverseOrder.cs +++ b/Code/Epic.Query.Object/ReverseOrder.cs @@ -55,6 +55,12 @@ public OrderCriterion Reversed } } + /// + /// Chain the specified criterion after the current one. + /// + /// + /// Another crierion. + /// public override OrderCriterion Chain (OrderCriterion other) { return new OrderCriteria(this, other); @@ -75,6 +81,18 @@ public override int Compare (TEntity x, TEntity y) return _toReverse.Compare(y, x); } + /// + /// Accept the specified visitor and context. + /// + /// + /// Visitor. + /// + /// + /// Context. + /// + /// + /// The type of the visit's result. + /// protected override bool SafeEquals (OrderCriterion other) { ReverseOrder reverseOther = other as ReverseOrder; @@ -88,6 +106,15 @@ private ReverseOrder(SerializationInfo info, StreamingContext context) _toReverse = (OrderCriterion)info.GetValue("C", typeof(OrderCriterion)); } + /// + /// Gets the object data to serialize. + /// + /// + /// Info. + /// + /// + /// Context. + /// protected override void GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue("C", _toReverse, typeof(OrderCriterion)); diff --git a/Code/Epic.Query.Object/Searchable.cs b/Code/Epic.Query.Object/Searchable.cs index 08ff92e2..69ccbe48 100644 --- a/Code/Epic.Query.Object/Searchable.cs +++ b/Code/Epic.Query.Object/Searchable.cs @@ -201,7 +201,7 @@ public static IOrderedSearch ThenBy(this /// The type of the identities of the entities searched by . /// /// is null. - /// is 0. + /// is 0. public static ISlicedSearch Take(this IOrderedSearch search, uint count) where TEntity : class where TIdentity : IEquatable @@ -262,7 +262,7 @@ public static ISlicedSearch Skip(this IO /// The type of the identities of the entities searched by . /// /// is null. - /// is 0. + /// is 0. public static ISlicedSearch Take(this ISlicedSearch search, uint count) where TEntity : class where TIdentity : IEquatable diff --git a/Tools/NantScripts/RunNUnit.include b/Tools/NantScripts/RunNUnit.include index cf5f9774..6a8b0dc0 100644 --- a/Tools/NantScripts/RunNUnit.include +++ b/Tools/NantScripts/RunNUnit.include @@ -37,7 +37,7 @@ -