Open sohaibameenpk007 opened 10 months ago
Doesn’t exist in .NET 6+. Model metadata is an ASP.NET Core MVC concept. What are you trying to do?
I am trying to get model metadata in .NET 6 Core MVC just like I have mentioned in the legacy code which I have posted before.
How can I create custom metadata and get it in .NET core?
On Mon, 1 Jan 2024 at 9:51 PM, David Fowler @.***> wrote:
Doesn’t exist in .NET 6+. Model metadata is an ASP.NET Core MVC concept. What are you trying to do?
— Reply to this email directly, view it on GitHub https://github.com/dotnet/aspnetcore/issues/53082#issuecomment-1873397955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVCWODNRT76HFEV5Q2KESWLYMLSQPAVCNFSM6AAAAABBJDQF5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGM4TOOJVGU . You are receiving this because you authored the thread.Message ID: @.***>
Is there an existing issue for this?
Describe the bug
I am trying to create a custom metadata provider in .NET 6 just like we have in .NET code given below
`[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class IsIdentifierAttribute : Attribute, IMetadataAware { public bool IsIdentifier { get; set; }
}`
1- Is there any way to do this in .NET 6? 2- I want to get metadata for type given at runtime without using DI just like its being done in .NET code given below.
ModelMetadataProviders.Current.GetMetadataForType(null, typeof(TEntity))
Please provide your response on this.
Thanks, Sohaib
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET 6
Anything else?
No response