From e5350b2ae857156e3aa8249834b35c1d7e3acca4 Mon Sep 17 00:00:00 2001 From: Wvader <34067397+wvader@users.noreply.github.com> Date: Tue, 3 Jan 2023 15:27:30 +0000 Subject: [PATCH] listObjectFullTypeName wip --- src/BlueWest.EfMethods/EfGeneratorContext.cs | 4 +++- src/BlueWest.EfMethods/Models.cs | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/BlueWest.EfMethods/EfGeneratorContext.cs b/src/BlueWest.EfMethods/EfGeneratorContext.cs index 174cefc..a3c54d5 100644 --- a/src/BlueWest.EfMethods/EfGeneratorContext.cs +++ b/src/BlueWest.EfMethods/EfGeneratorContext.cs @@ -513,6 +513,8 @@ namespace BlueWest.EfMethods #pragma warning disable CS8629 var keyFullTypeName = keyMemberType.Value.Type.ToDisplayString(); #pragma warning restore CS8629 + + var listObjectFullTypeName = ""; // Try grabbing string literal if there's no nameof in it @@ -535,7 +537,7 @@ namespace BlueWest.EfMethods returnTypeFullName = efTypeofSymbols[0].ToDisplayString(); } - return new EfGetListModel(entityDataModel, listPropertyName, keyPropertyName, keyFullTypeName, returnTypeIdentifierName, returnTypeFullName); + return new EfGetListModel(entityDataModel, listPropertyName, listObjectFullTypeName,keyPropertyName, keyFullTypeName, returnTypeIdentifierName, returnTypeFullName); } private EfAddToListModel ExtractEfAddToListMethodsModel(MemberDeclarationSyntax uProperty, SemanticModel semanticModel, EfEntityDataModel entityDataModel) diff --git a/src/BlueWest.EfMethods/Models.cs b/src/BlueWest.EfMethods/Models.cs index 86100e7..2418404 100644 --- a/src/BlueWest.EfMethods/Models.cs +++ b/src/BlueWest.EfMethods/Models.cs @@ -156,6 +156,10 @@ namespace BlueWest.EfMethods internal class EfGetListModel : EfEntityDataModel { public string ListPropertyName { get; set; } + + public string ListObjectFullTypeName { get; set; } + + public string KeyPropertyName { get; set; } public string KeyFullTypeName { get; set; } public string ReturnTypeIdentifierName { get; set; } @@ -165,6 +169,7 @@ namespace BlueWest.EfMethods public EfGetListModel( EfEntityDataModel entity, string listPropertyName, + string listObjectFullTypeName, string keyPropertyName, string keyFullTypeName, string returnTypeIdentifierName, @@ -172,6 +177,7 @@ namespace BlueWest.EfMethods : base(entity.PropertyName, entity.EntityTypeFullName, entity.EntityTypeIdentifierName) { ListPropertyName = listPropertyName; + ListObjectFullTypeName = listObjectFullTypeName; KeyPropertyName = keyPropertyName; KeyFullTypeName = keyFullTypeName; ReturnTypeIdentifierName = returnTypeIdentifierName;