From 2bc88bb91c5be1a4d3cd378d2182608f1c4aaffb Mon Sep 17 00:00:00 2001 From: Wvader <34067397+wvader@users.noreply.github.com> Date: Mon, 26 Dec 2022 20:38:00 +0000 Subject: [PATCH] Expose entity fulltype name in EfGetMany --- .../EfMethodsSource/EfGetOneWithTemplateSource.cs | 4 +++- src/BlueWest.EfMethods/Models.cs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/BlueWest.EfMethods/EfMethodsSource/EfGetOneWithTemplateSource.cs b/src/BlueWest.EfMethods/EfMethodsSource/EfGetOneWithTemplateSource.cs index 3d57575..e3ab629 100644 --- a/src/BlueWest.EfMethods/EfMethodsSource/EfGetOneWithTemplateSource.cs +++ b/src/BlueWest.EfMethods/EfMethodsSource/EfGetOneWithTemplateSource.cs @@ -57,7 +57,7 @@ namespace BlueWest.EfMethods { var returnTypeFullName = model.ReturnTypeFullName; var entityTypeName = model.EntityTypeIdentifierName; - + var entityFullTypeName = model.EntityTypeFullName; var contextFullName = methodsModel.ContextFullType; var findEntityVarName = model.EntityTypeIdentifierName.ToCamelCase(); var propertyName = model.PropertyName; @@ -67,6 +67,8 @@ namespace BlueWest.EfMethods var templateToSourceBuilder = new StringBuilder(addSourceTemplate); templateToSourceBuilder .Replace("{returnTypeFullName}", returnTypeFullName) + .Replace("{entityFullTypeName}", entityFullTypeName) + .Replace("{entityTypeName}", entityTypeName) .Replace("{contextFullName}", contextFullName) .Replace("{contextFullName}", contextFullName) diff --git a/src/BlueWest.EfMethods/Models.cs b/src/BlueWest.EfMethods/Models.cs index 86100e7..da0fb60 100644 --- a/src/BlueWest.EfMethods/Models.cs +++ b/src/BlueWest.EfMethods/Models.cs @@ -117,6 +117,11 @@ namespace BlueWest.EfMethods { public string ReturnTypeIdentifierName { get; set; } public string ReturnTypeFullName { get; set; } + + public string MainTypeIdentifierName { get; set; } + public string MainTypeFullName { get; set; } + + public EfGetManyModel(EfEntityDataModel entity, string returnTypeFullName, string returnTypeIdentifierName) : base(entity.PropertyName, entity.EntityTypeFullName, entity.EntityTypeIdentifierName)