From dc23c797975f1e4d835b5e67a5c0972813567ce1 Mon Sep 17 00:00:00 2001 From: CodeLiturgy Date: Wed, 7 Sep 2022 18:27:06 +0100 Subject: [PATCH] Initial version --- .../AttributeSources/EfGetManyAttributeSource.cs | 12 +++++------- .../AttributeSources/EfGetOneByAttributeSource.cs | 12 ++++-------- .../EfUpdateMethodsAttributeSource.cs | 15 +++++---------- .../AttributeSources/GetOneWIthAttributeSource.cs | 11 ++++------- 4 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetManyAttributeSource.cs b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetManyAttributeSource.cs index 3a7869b..9a6ca5b 100644 --- a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetManyAttributeSource.cs +++ b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetManyAttributeSource.cs @@ -20,13 +20,11 @@ namespace BlueWest.EfMethods.Sources .WriteLine($"namespace {RootNamespace}") .WriteOpeningBracket(); - if (options.GenerateXmlDocument) - { - builder - .WriteLine("/// ") - .WriteLine("/// Attribute for generating a function to get one EF entity with a predicate as argument and a return type for the projection.") - .WriteLine("/// "); - } + builder + .WriteLine("/// ") + .WriteLine("/// Attribute for generating a function to get many entities.") + .WriteLine("/// "); + builder .WriteLine("[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]") diff --git a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetOneByAttributeSource.cs b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetOneByAttributeSource.cs index 00e5c35..d1c1cc9 100644 --- a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetOneByAttributeSource.cs +++ b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfGetOneByAttributeSource.cs @@ -20,14 +20,10 @@ namespace BlueWest.EfMethods.Sources .WriteLine($"namespace {RootNamespace}") .WriteOpeningBracket(); - if (options.GenerateXmlDocument) - { - builder - .WriteLine("/// ") - .WriteLine("/// Generate Add methods for interacting with the entity") - .WriteLine("/// "); - } - + builder + .WriteLine("/// ") + .WriteLine("/// Generate Get One Entity helper functions with the specified nameof of the property, and the return type.") + .WriteLine("/// "); builder .WriteLine("[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]") .WriteLine($"public sealed class {AttributeName}Attribute : Attribute") diff --git a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfUpdateMethodsAttributeSource.cs b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfUpdateMethodsAttributeSource.cs index acbaeda..4476ae9 100644 --- a/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfUpdateMethodsAttributeSource.cs +++ b/src/BlueWest.EfMethods/EfMethods/AttributeSources/EfUpdateMethodsAttributeSource.cs @@ -17,13 +17,10 @@ namespace BlueWest.EfMethods.Sources .WriteLine($"namespace {RootNamespace}") .WriteOpeningBracket(); - if (options.GenerateXmlDocument) - { - builder - .WriteLine("/// ") - .WriteLine("/// Generate Add methods for interacting with the entity") - .WriteLine("/// "); - } + builder + .WriteLine("/// ") + .WriteLine("/// Generate update methods for this Db property") + .WriteLine("/// "); builder .WriteLine("[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]") @@ -31,9 +28,7 @@ namespace BlueWest.EfMethods.Sources .WriteOpeningBracket(); builder - .WriteLine($"public {AttributeName}Attribute(Type updateType, Type returnType, string keyPropertyMemberName)") - .WriteOpeningBracket() - .WriteClosingBracket() + .WriteLine($"public {AttributeName}Attribute(Type updateType, Type returnType, string keyPropertyMemberName){"{}"}") .WriteLine(); builder diff --git a/src/BlueWest.EfMethods/EfMethods/AttributeSources/GetOneWIthAttributeSource.cs b/src/BlueWest.EfMethods/EfMethods/AttributeSources/GetOneWIthAttributeSource.cs index a6d3698..3c711b6 100644 --- a/src/BlueWest.EfMethods/EfMethods/AttributeSources/GetOneWIthAttributeSource.cs +++ b/src/BlueWest.EfMethods/EfMethods/AttributeSources/GetOneWIthAttributeSource.cs @@ -20,13 +20,10 @@ namespace BlueWest.EfMethods.Sources .WriteLine($"namespace {RootNamespace}") .WriteOpeningBracket(); - if (options.GenerateXmlDocument) - { - builder - .WriteLine("/// ") - .WriteLine("/// Attribute for generating a function to get one EF entity with a predicate as argument and a return type for the projection.") - .WriteLine("/// "); - } + builder + .WriteLine("/// ") + .WriteLine("/// Generate methods to get the first result with a given predicate.") + .WriteLine("/// "); builder .WriteLine("[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]")