From 6905ebc9b163f508b2786ac7e85e99b2500e6fdd Mon Sep 17 00:00:00 2001 From: "Kevin E. Ford" <4380198+Bowman74@users.noreply.github.com> Date: Sun, 29 Dec 2024 23:04:08 -0700 Subject: [PATCH] Feature/4417 data portal annotations (#4419) * #4417 Changes for data portal annotations * #4417 Fix spacing --- Source/Csla/DataPortalClient/DataPortalFactory.cs | 8 +++++++- Source/Csla/IDataPortalFactory.cs | 8 +++++++- Source/Csla/IDataPortalT.cs | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Source/Csla/DataPortalClient/DataPortalFactory.cs b/Source/Csla/DataPortalClient/DataPortalFactory.cs index dcab490a8d..7529feb8d6 100644 --- a/Source/Csla/DataPortalClient/DataPortalFactory.cs +++ b/Source/Csla/DataPortalClient/DataPortalFactory.cs @@ -6,6 +6,8 @@ // Implements a data portal service //----------------------------------------------------------------------- +using System.Diagnostics.CodeAnalysis; + namespace Csla.DataPortalClient { /// @@ -29,7 +31,11 @@ public DataPortalFactory(IServiceProvider serviceProvider) /// Get a client-side data portal instance. /// /// Root business object type - public IDataPortal GetPortal() + public IDataPortal GetPortal< +#if NET8_0_OR_GREATER + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] +#endif + T>() { return (IDataPortal)ServiceProvider.GetService(typeof(IDataPortal)); } diff --git a/Source/Csla/IDataPortalFactory.cs b/Source/Csla/IDataPortalFactory.cs index 840a50fa08..f2a727b7cd 100644 --- a/Source/Csla/IDataPortalFactory.cs +++ b/Source/Csla/IDataPortalFactory.cs @@ -5,6 +5,8 @@ // // Implements a data portal service //----------------------------------------------------------------------- +using System.Diagnostics.CodeAnalysis; + namespace Csla { /// @@ -18,6 +20,10 @@ public interface IDataPortalFactory /// Get a client-side data portal instance. /// /// Root business object type - IDataPortal GetPortal(); + IDataPortal GetPortal< +#if NET8_0_OR_GREATER + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] +#endif + T>(); } } diff --git a/Source/Csla/IDataPortalT.cs b/Source/Csla/IDataPortalT.cs index 1f5e4c17c3..e96ad80a70 100644 --- a/Source/Csla/IDataPortalT.cs +++ b/Source/Csla/IDataPortalT.cs @@ -6,13 +6,19 @@ // Interface defining the members of the data portal type //----------------------------------------------------------------------- +using System.Diagnostics.CodeAnalysis; + namespace Csla { /// /// Interface defining the members of the data portal type. /// /// - public interface IDataPortal + public interface IDataPortal< +#if NET8_0_OR_GREATER + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] +# endif + T> { /// /// Starts an asynchronous data portal operation to