Questions tagged [fieldinfo]

54 questions
0
votes
1 answer

Using Swagger with scala-activerecord

I have an active record like this: case class Person(name: String) extends ActiveRecord object Person extends ActiveRecordCompanion[Person] I added Swagger annotations: @ApiModel(value = "Person", description = "A person.") case class Person( …
mirelon
  • 4,896
  • 6
  • 40
  • 70
0
votes
1 answer

Get value of field that is in class which is also field in another class

So, lets start from code so I can better explain myself. I have MyClass class, which contains an int field, also Foo class contains MyClass as field. I want to get value of int field from MyClass using reflection. public class Foo { public MyClass…
0
votes
0 answers

How do I get the types and values inside of a C# FieldInfo object?

I have tried to find a solution for this but I cannot. Given the following classes and Program: [Serializable] public class SomeClass { public string OneProp { get; set; } public string TwoProp { get; set; } public string OneField; …
0
votes
1 answer

How to get attributes on a referenced field

I have a question: Is there an elegant way of getting Attributes on a referenced field. Ie.: public class C1: Base { [MyAttribute] public string Field1; } public class Base { private void Do(ref string field) { if (field…
Luka
  • 3
  • 1
0
votes
2 answers

Is there a way to get field name including class containing it and another class containing this class if field passed into function as object?

I doing next thing... I pass into some function the field of some controls, like: class ScenarioSelector { public ScenarioSelector() { SubjectInfo.SetStr(lbl_labs_header.Text); } } class SubjectInfo { public static void…
Kosmo零
  • 4,001
  • 9
  • 45
  • 88
0
votes
1 answer

System.Reflection GetNestetTypes All fields declared Name or value

how do i get a list of all fields within all nested classes class AirCraft { class fighterJets { public string forSeas = "fj_f18"; public string ForLand = "fj_f15"; } class helicopters { public string…
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
0
votes
1 answer

How do I retrieve the values for parameters if the parameter name and field name are different using reflection?

How do I retrieve the values for parameters if the parameter name and field name are different? I have researched so far for about 2 days and not able to find a solution. Any help appreciated. I have provided the sample code below. class Class1 {…
0
votes
2 answers

System.Reflection, how to get field & property position?

Question: I use the below class to serialize a csv file to List Then I convert the List to a datatable using MyConvertTo (listed below as well). The problem now is, MyConvertTo changes the position of the…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
-1
votes
2 answers

How do I use Reflection to get the fields of a method?

How can I user reflection to get the fields inside a method? I tried to use the MethodInfo and then GetFields but the values returned are not the fields I defined within the method. For example, using the code below, how would I get the FieldInfo…
j2associates
  • 1,115
  • 10
  • 19
1 2 3
4