Skip to main content

Questions tagged [modelmetadata]

The tag has no summary.

Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

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 ...
Maksim Melnichuk's user avatar
0 votes
3 answers
662 views

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 https://...
user14554500's user avatar
2 votes
0 answers
190 views

I have an asp.net core 3.1 based app. I like to utilize Display-Templates and Editor-Templates to create the editor views. I am trying to figure out the best approach on how to create editor templates ...
Jay's user avatar
  • 2,432
0 votes
1 answer
1k views

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's user avatar
  • 1
5 votes
0 answers
291 views

I have an ASP.NET Core 3.1 web API application that has various models used for by its endpoints for input and output of data. Because other C# applications will be communicating with this one, I ...
Ian Kemp - SO dead by AI greed's user avatar
0 votes
2 answers
2k views

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 ...
JHW's user avatar
  • 136
1 vote
1 answer
282 views

I have a ViewModel containing this property: ...
Wadjey's user avatar
  • 165
0 votes
1 answer
664 views

Where I can find AssociatedMetadataProvider in .Net Core? Or is there a way to implement GetTypeDescriptor in DefaultModelMetadataProvider? In MVC 5 the DataAnnotationsModelMetadataProvider inherits ...
Cyril Iselin's user avatar
0 votes
1 answer
273 views

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 ...
mirek stohr's user avatar
0 votes
0 answers
113 views

I have an application that is written using C# on the top of Asp.Net MVC 5. I have the following model ...
Junior's user avatar
  • 12.1k
3 votes
1 answer
3k views

I have a project written in C# on the top on ASP.NET MVC 5 framework. I am trying to decouple my views from my view model so I can make my views reusable. With the ...
Junior's user avatar
  • 12.1k
2 votes
0 answers
351 views

I have a test of an HtmlHelper extension method that works great when it is the only test that I run. It appears below. All of my other unit tests succeed when I run them, as long as I don't run ...
MKP's user avatar
  • 65
0 votes
0 answers
275 views

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 ...
webhero77's user avatar
0 votes
1 answer
2k views

How to disable the [Required] attribute that has been set on a model property. I tried with below code using new keyword but ...
Neo's user avatar
  • 16.3k
6 votes
2 answers
10k views

In Entity Framework 6 I could get the ModelMetadata for a class (myModel) like this: ...
simon of earth's user avatar
3 votes
1 answer
1k views

In my Java application, I store some data in serveral files in a proprietary format. At runtime, the content and some metadata are stored in an object. In my current approach, the class looks like ...
Franz Deschler's user avatar
0 votes
1 answer
203 views

I'm trying to extend CachedDataAnnotationsModelMetadataProvider to not cache Custom ValidationAttribute. How can i achieve this? ...
Igoris's user avatar
  • 1,648
4 votes
1 answer
7k views

I am into a situation that my table names are different from the class property on the model using mapping in EF 6. the Model and Database goes like this: ...
ECie's user avatar
  • 1,547
2 votes
1 answer
1k views

I am writing a custom ModelMetadataProvider which extends default DataAnnotationsModelMetadataProvider. Unfortunately i came ...
Alex Art.'s user avatar
  • 8,791
0 votes
1 answer
356 views

I'm having problems with my localized Model attributes as we decided to not use the build-in localization functionallity. ...
Sebastian Jonas's user avatar
-1 votes
2 answers
1k views

I am trying to access a model's metadata attributes to create a helper to automatically add HtmlAttributes based on DataAnnotations. Problem is, the attributes are always empty. I have 2 basic ...
Erick's user avatar
  • 6,119
5 votes
1 answer
3k views

I have developed a MVC helper for generating display and editable tables (a jquery plugin is required to allow dynamic addition and deletion of rows with full postback in the editable tables) e.g. <...
user avatar
4 votes
1 answer
8k views

I'm seeing alternative approaches to this such as AdditionalValues, but I'm wondering if it's possible to end up in a scenario where you can add a new property to the ModelMetadata object available in ...
Jacques's user avatar
  • 7,175
1 vote
0 answers
118 views

I have something like that: [ViewTerms] public class Foo { [Term] public string Name { get; set; } } my ViewTermAttribute sets some additional values ...
MuriloKunze's user avatar
  • 15.6k
5 votes
1 answer
2k views

I need clarification on how to implement Betty's code solution to transferring data annotation metadata to ViewModels with AutoMapper (see here). Or if you have a better way, please share that. Maybe ...
Nicholas Petersen's user avatar
2 votes
2 answers
3k views

I want to make additional editor template for the Int32. In it I want to get all attributes(custom/default-data-annotations) and do some work with them: ...
Maris's user avatar
  • 4,786
1 vote
1 answer
311 views

I'm trying to use System.Reflection to get the same result for a property as with using the metadata, specifically the ...
Andrei V's user avatar
  • 7,516
4 votes
1 answer
1k views

We are looking to use CachedDataAnnotationsModelMetadataProvider as it improves performance and we use a lot of Meta Data in our MVC4 application. We are currently ...
GraemeMiller's user avatar
  • 12.3k
0 votes
1 answer
664 views

I've searched all around, read all the posts related to creating a strongly typed helper, but none have addressed my issue. Problem: When referencing a simple property, all works well: ...
Jack's user avatar
  • 9,252
0 votes
0 answers
140 views

I need reading material on how modelmetadata is populated and when the OnMetadataCreated method is called in the framework. When I created a viewmodel that contains a nested viewmodel, ...
John Doe's user avatar
3 votes
1 answer
2k views

I am trying to create a custom ModelMetadataProvider to provide unobtrusive attributes for the JQuery UI Autocomplete widget. I have a custom attribute that looks ...
Benjamin Gale's user avatar
3 votes
1 answer
3k views

I have interface of a model declared, with class implementing it: ...
Philipp Munin's user avatar
4 votes
1 answer
3k views

I have an ASP.NET MVC 4 site and I am passing a nested property to an EditorTemplate and building the field name using ViewData.ModelMetadata.PropertyName however, ...
Greg B's user avatar
  • 15k
0 votes
0 answers
93 views

Given an expression such as: m => m.Employee.Address.Line1 I need to create a function that can walk the expression, pulling out the objects involved, or AT LEAST the final object in the chain (i.e. ...
Frank's user avatar
  • 1
7 votes
2 answers
2k views

I have fields that different people should see in different names. For example, suppose I have the following user types: ...
Kobi's user avatar
  • 139k
2 votes
0 answers
482 views

I am trying to create a custom HtmlHelper that displays a numeric value formatted to a given number of decimal places. My idea is to change the ModelMetadata.DataFormatString property to achieve this. ...
Paul Taylor's user avatar
  • 5,761
0 votes
0 answers
51 views

One of the properties in my model is decorated with Hide attribute. When I load a page this property is not displayed (as expected). When I click "Back" and then "...
user981375's user avatar
0 votes
2 answers
10k views

I have an Entity Framework 4.1 model that supports multiple ASP.NET MVC web applications. I use DataAnnotations to define and localize label text and validation rules and error messages. For some ...
Paul Taylor's user avatar
  • 5,761
2 votes
1 answer
4k views

I am trying to build an html helper that would have access to modelmetadata. I need both versions of helper to work: from string expression and from lambda expression: Example: ...
Dmitry Efimenko's user avatar
1 vote
2 answers
3k views

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 ...
Tim Bee's user avatar
  • 2,240
0 votes
2 answers
535 views

I'm using VAB to validate some classes with attributes and I'm using a metadata class to share the same validation among different classes. When i try to validate an object in the controller (btw i'm ...
JPP's user avatar
  • 460
1 vote
1 answer
1k views

*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 ...
Humble Rumble's user avatar
0 votes
1 answer
233 views

I have the following scenario ...
marcus's user avatar
  • 10.2k
2 votes
1 answer
2k views

I'm trying to implement some custom model metadata in ASP.NET MVC 3. I can't use data annotation attributes since some of the metadata could change based on configured values, so I need a solution ...
Dave A's user avatar
  • 484
11 votes
2 answers
3k views

Say I have a model like this ...
Chris's user avatar
  • 8,522
16 votes
3 answers
6k views

I use AutoMapper to map my domain objects to my view models. I have metadata in my domain layer, that I would like to carry over to the view layer and into ModelMetadata. (This metadata is not UI ...
smartcaveman's user avatar
  • 42.6k
0 votes
2 answers
538 views

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 ...
Dzyann's user avatar
  • 5,278
27 votes
5 answers
31k views

I'm curious to find out if it is possible to override the [Required] attribute that has been set on a model. I'm sure there most be a simple solution to this problem, any takers?
Ryan Smith's user avatar
0 votes
2 answers
2k views

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: ...
ElHaix's user avatar
  • 13.1k
1 vote
1 answer
427 views

I have a special case where I would need the ability to use multiple ModelMetadaProviders in an application. Certain area would use a specific provider, another area will use some other. I mainly need ...
mare's user avatar
  • 13.1k