impromptu-interface

Impromptu: Could not load type because it attempts to implement a class as an interface

假如想象 提交于 2020-01-05 08:00:48
问题 I have just started using Impromptu after a recommendation from someone on stack. I believe I have implemented it correctly but I am getting the error "Could not load type because it attempts to implement a class as an interface" In my portable class library I have the following model: public class Route { public User user { get; set; } } public class User { public Name name { get; set; } } public class Name { public string title { get; set; } public string firstName { get; set; } public

Make new object with reflection?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 07:50:16
问题 I'm not sure if this is possible and after lengthy research I haven't found something conclusive. I am trying to dynamically create a new object (itself a new Type) from a dictionary. So say I have key and value that key and value will become a property that returns the value. Something that I can use like this: Sample code public T getObject(Dictionary<string, string> myDict) { // make a new object type with the keys and values of the dictionary. // sample values in dictionary: // id :