Questions tagged [dynamic-properties]
75 questions
1
vote
1 answer
WebApi2 - How to add dynamic properties to the Model
I hope this question has been asked before and I am just not finding it. I am writing a set of Restful API's in WebAPI2.
I understand that the API Controllers will be returning models in their response. My question is, can I create dynamic…

Ben Haynie
- 115
- 9
1
vote
0 answers
boost graph library read unkonwn graph
I write several graphs with n vertex, m edges and S attributes into file.
now I need to read these unknown number of graphs from Graphviz DOT file by Boost graph library. How to read these unknown number of graphs with unknown number of vertex,…

david
- 31
- 3
1
vote
0 answers
Matlab calsses - PreGet listener on structures
I am using some basic Matlab classes with some dynamic defined properties. I added listeners 'PreGet' and 'PostGet' for a property. My property can be a simple variable or a structure.
This is my class:
classdef myClass < dynamicprops
methods
…

uhnucross
- 103
- 1
- 8
1
vote
0 answers
Adding a TypeConverter to dynamic properties
I am coding a C# forms application where an object has custom properties for a PropertyGrid. These custom properties are displayed at runtime.
Here is my code:
private readonly List props = new…

Simon
- 7,991
- 21
- 83
- 163
1
vote
1 answer
Dynamic Entity for Raw Sql Query using Entity Framework
I am scratching my head here. I have a bootstrap modal that has a field for entering in a sql query. The query I pass uses an AJAX call to a controller and executes the sql query using the code below and returns a JSON object. Something like…

dh6984
- 108
- 12
1
vote
2 answers
Laravel 5 - using dynamic properties in view
I have a dynamic property user in my model:
class Training extends Model
{
...
public function user()
{
return $this->belongsTo('App\User');
}
}
And I can easy get username in controller like…

Limon Monte
- 52,539
- 45
- 182
- 213
1
vote
2 answers
Shorthand setter declaration for a subscript of an array in Swift
In my last question, I asked how to write setter for a subscript of a computed property in Swift. I think my question was not substantial enough to be understood. The answer given was either incorrect or complicated for a small task. After a long…

donkey
- 4,285
- 7
- 42
- 68
1
vote
2 answers
JavaScript Dynamic variables
With this script I add variables to an object on runtime :
function MyDocument(someDocument)
{
if(!(someDocument instanceof KnownDocumentClass))
throw "Object must be an instance of KnownDocumentClass: " + someDocument;
this.Document =…

Kooki
- 1,157
- 9
- 30
1
vote
1 answer
How to create a dynamic property in a class?
I need to create a property called "aip-aup" in a class but I can't get it to work.
First tried to put it up with the property definitions. Unfortunately bracketed property-definitions are not allowed.
This fails (in the…

silkfire
- 24,585
- 15
- 82
- 105
1
vote
1 answer
size in Memory of handle object property
Hi I'm using an object with superclass dynamicprops & matlab.mixin.Copyable
Now I would like to now the size (memorywise) of each of the dynamic properties. I tried stuff like whos and getfield. But it seems like I have a very hard time to find…

magu_
- 4,766
- 3
- 45
- 79
0
votes
1 answer
Why can attributes not be applied from traits?
As of version 8.0, PHP has gained the ability to add attributes to various entities.
With PHP 8.2, creating dynamic properties has been deprecated: attempting to set a property on a class that does not have that property explicitly declared now…

Janus Bahs Jacquet
- 859
- 1
- 11
- 27
0
votes
0 answers
Add dynamicprops with a getter that doesn't engage on construction of object
I want to create a class that lets me load data only when a channel is requested.
I want it to work something like this:
my_file = Datafile('big_and_slow_file.dat');
ch1 = my_file.Channel_1;
ch102 = my_file.Channel_102;
In this case the file…

danneedebro
- 57
- 8
0
votes
0 answers
kotlin possible use annotation dynamic parameter inside custom annotation?
[What I would like to do kotlin]
wrap an existing annotation
use dynamic parameters
[code]
@Target(ElementType.TYPE, ElementType.METHOD)
@Inherited
@Documented
@Cacheable(cacheNames = {custom_properties}, cacheManager = "cacheManager") // exist…

kai
- 1
0
votes
1 answer
How to use `boost::dynamic_properties` with vector valued property maps?
I would like to include a map> in a boost::dynamic_properties property:
#include

Quappas
- 79
- 7
0
votes
0 answers
Laravel Elequent relationship method naming convension
I have a strange behavior in naming model relationship in my laravel application (Laravel 9, PHP 8.1)
I have two models
class User extends Model
{
public function userSocialProviders()
{
return…

Mina Zakaria
- 63
- 9