dynamic-properties

C# ASP.Net MVC dynamic object properties

我的未来我决定 提交于 2020-01-06 11:46:08
问题 I am working on a ASP.NET MVC project, with C# , and EF code first. I am required to add dynamic properties to entities. For example - I have a car as a base object. I can add custom properties for it like engine power, length, color etc etc. Properties can be boolean, int, string or select options (ie, i have to create checkbox, input or select html elements when a user inputs values for those properties). Properties must have custom validation rules (i.e., required, number only, range only

Spring Data Neo4j 5 update dynamic properties

大兔子大兔子 提交于 2019-12-24 09:05:55
问题 I have the following entity: @NodeEntity public class Value { @Properties(prefix = "property", allowCast = true) private Map<String, Object> properties; } I have added the following properties: Map<String, Object> properties1 = new HashMap<>(); properties.put("key1", "one"); properties.put("key2", "two"); value.setProperties(properties1); Right now on the database level, I have the Value node with two properties: property.key1 = "one" property.key2 = "two" Now, I'd like to update the

boost::dynamic_properties and immutable graph object

女生的网名这么多〃 提交于 2019-12-23 16:18:12
问题 after implementing some algorithm using the BGL, im trying to provide io functions using GraphML. However, i dont manage to compile a suitable operator<< that takes a const Graph reference. Here is a boiled down example: // use bundled properties for vertices and edges struct VertexProperty { double error; }; typedef boost::adjacency_list< boost::setS, boost::setS, boost::undirectedS, VertexProperty> Graph; typedef typename boost::graph_traits<Graph>::edge_descriptor edge_descriptor; typedef

Is it possible to add methods on the fly to MATLAB classes?

六眼飞鱼酱① 提交于 2019-12-20 23:32:21
问题 Writing a subclass of dynamicprops allows to me to add properties dynamically to an object: addprop(obj, 'new_prop') This is great, but I would also love to create set / get functions for these properties on the fly. Or analysis functions that work on these dynamic properties. My experience with Matlab has been so far, that once I create an instance of a class, adding new methods is not possible. That is very cumbersome, because my object may contain a lot of data, which I'll have to re-load

Objective C - respondsToSelector for dynamic properties

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:43:42
问题 I am currently facing the problem to check whether a property of an Object (NSManagedObject) exists or not. Unfortunately the method [[MyObject class] respondsToSelector:@selector(myProperty)]; always returns NO. I think it's because the property generated by CoreData is a new style property ala @property (nonatomic, strong) NSString *myProperty So any ideas how to solve this issue? I would really appreciate all of your suggestions ;) Thanks in advance! Alex 回答1: [[MyObject class]

Boost: access graph specific properties with read_graphml()

社会主义新天地 提交于 2019-12-11 00:02:56
问题 I am trying to read graph related (custom) properties from a .graphml file created with yEd using the Boost Graph library. Reading vertex and edge (dynamic_)properties works but my graph properties are always empty . I've also came across how to read graph-domain attributes with boost::read_graphml? but that solution just produces empty strings (it's in the code below). Apart from that, I was not able to find much information about the problem. Here's the shortened code (complete working

Laravel 5 - using dynamic properties in view

泄露秘密 提交于 2019-12-08 08:17:45
问题 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 this: Training::find(1)->user->name But I don't know how to perform the same in view. I tried this: Controller: return view('training/single', Training::find(1)); View: {{ $user->name }}; but without success, I'm getting error Undefined variable: user . So it's look like I can't access dynamic property

Objective C - respondsToSelector for dynamic properties

这一生的挚爱 提交于 2019-12-05 18:46:00
I am currently facing the problem to check whether a property of an Object (NSManagedObject) exists or not. Unfortunately the method [[MyObject class] respondsToSelector:@selector(myProperty)]; always returns NO. I think it's because the property generated by CoreData is a new style property ala @property (nonatomic, strong) NSString *myProperty So any ideas how to solve this issue? I would really appreciate all of your suggestions ;) Thanks in advance! Alex [[MyObject class] respondsToSelector:...] asks whether the metaobject responds to that selector. So, in effect, it asks whether there is

Dynamically assign the getter for a dependent property in MATLAB

99封情书 提交于 2019-12-05 00:36:46
问题 In Matlab, I can define a class as such: classdef klass < handle properties(Dependent) prop end end Matlab is perfectly happy instantiating an object of this class, even without defining a getter for prop . It only fails when I try to access it (understandably). I'd like to set the GetMethod dynamically based upon the property's name. Unfortunately, even when the property is Dependent, the meta.property field for GetMethod is still read-only. And while inheriting from dynamicprops could allow

Dynamically assign the getter for a dependent property in MATLAB

ⅰ亾dé卋堺 提交于 2019-12-03 16:52:17
In Matlab, I can define a class as such: classdef klass < handle properties(Dependent) prop end end Matlab is perfectly happy instantiating an object of this class, even without defining a getter for prop . It only fails when I try to access it (understandably). I'd like to set the GetMethod dynamically based upon the property's name. Unfortunately, even when the property is Dependent, the meta.property field for GetMethod is still read-only. And while inheriting from dynamicprops could allow adding a property and programmatically setting its GetMethod in every instance, I don't believe it