Questions tagged [modelmetadata]
88 questions
1
vote
0 answers
Get AdditionalValues from containerType's instance
I have something like that:
[ViewTerms]
public class Foo
{
[Term]
public string Name { get; set; }
}
my ViewTermAttribute sets some additional values in ModelMetaData:
public class ViewTermsAttribute : Attribute, IMetadataAware
{
…

MuriloKunze
- 15,195
- 17
- 54
- 82
1
vote
1 answer
Equivalent for "ModelMetadata.IsComplexType" using Reflection
I'm trying to use System.Reflection to get the same result for a property as with using the metadata, specifically the IsComplexType property. The problem that I'm facing is that I couldn't find the logic that MVC Framework uses to determine if a…

Andrei V
- 7,306
- 6
- 44
- 64
1
vote
2 answers
How to add MetaData to a dynamically build MVC3 ViewModel?
One of the key features of a project I'm working on is the ability for the user to configure Forms (as in "Forms" to fill-up) based on a pool of pre-existing field types (well known types, for instance "user name", "date of birth" etc. but also…

Timothée Bourguignon
- 2,190
- 3
- 23
- 39
1
vote
1 answer
How do I Get Full Html Field Name for an item in a list on my model at controller level?
*First Post
I have a JQuery error handler for my Ajax posts that I must use, it appends an error to the html based on the field name for that element like this
$(document).ready(function () {
function myHandler(e, error) {
var tag = "";
if…

Humble Rumble
- 1,222
- 8
- 15
0
votes
2 answers
In MVC 3.0 when Setting IsRequired to the ModelMetadata of a Property, it doesn't add the validation
There are certain properties in my application that I need to set dynamically whether they are required or not, therefore I can not use the [Required] atribute of Data Annotations.
Maybe this is not the best way to achieve what I want. So I will…

Dzyann
- 5,062
- 11
- 63
- 95
0
votes
2 answers
WCF model class from metadata not updating
I have a WCF service that uses a separate project for a DAL, which I have a reference to, and can access the entity objects with the DAL, through the service as such:
[OperationContract]
GeoLocations GetLocations();
This returns a…

ElHaix
- 12,846
- 27
- 115
- 203
0
votes
0 answers
What is the best way to read metadata from onnx model from C++?
I have model in onnx format that contains attribute "list_classes". I run it with opencv dnn. I need to read this list using C++.
I tried opencv dnn library, but it seems like there is no instruments for that.
I tried onnxruntime, but I can't even…
0
votes
2 answers
MetadataType not working to merge metadata having followed Microsoft tutorial for data first approach
I have tried to simplify this problem as much as possible and cannot find a solution or fix.
I have followed the second approach ("Add metadata class") in this Microsoft tutorial…

user14554500
- 3
- 2
0
votes
1 answer
How can I get the EF Core model configuration entity property comment set in HasComment as the html title attribute
Trying to set the title attribute of an html element as the parameter passed to the entity.Property().HasComment(comment) method.
I've tried with no luck:

Leo
- 1
- 1
0
votes
2 answers
Accessing custom attributes from model metadata in a tag helper
I am working on a new project in .net Core having previously been working with .net Framework.
I wish to produce html select elements for boolean properties but using custom values instead of True and False (mainly "Yes" and "No"). In previous…

JHW
- 124
- 1
- 11
0
votes
1 answer
AssociatedMetadataProvider in ASP.NET Core
Where I can find AssociatedMetadataProvider in .Net Core?
Or is there a way to implement GetTypeDescriptor in DefaultModelMetadataProvider?
In MVC 5 the DataAnnotationsModelMetadataProvider inherits from AssociatedMetadataProvider which had a method…

Cyril Iselin
- 596
- 4
- 20
0
votes
1 answer
Spring Batch metadata database transaction problem
I am using Spring Batch (version 4.1.2). The problem is the following:
1/ batch job is step oriented (2 steps), the first step loads data from oracle database (customer orders - the only small amount of data), filters them for further processing and…

mirek stohr
- 1
- 2
0
votes
0 answers
Using what expression I can get ModelMetadata info for a single item from a collection?
I have an application that is written using C# on the top of Asp.Net MVC 5.
I have the following model
public class SomeViewModel
{
public IList Days { get; set; }
......
}
public class CheckBoxListItem
{
public bool…

Junior
- 11,602
- 27
- 106
- 212
0
votes
0 answers
Entity Framework Core metadata is different than model and DB. How to refresh?
I'm new to using EF but it was relatively simple to implement for me, the problem came when I need to change the model. I created a column that I later deleted. However, at runtime the ghost column is causing an Invalid column error.
I have added…

webhero77
- 1
- 1
0
votes
1 answer
How can I disable required attribute on a property in a model in web api?
How to disable the [Required] attribute that has been set on a model property.
I tried with below code using new keyword but not working.
I also tried override keyword as well not worked.
ChildModel uses most of the properties of BaseModel that's…

Neo
- 15,491
- 59
- 215
- 405