Тёмный
No video :(

Reflection introduction for .NET Core (C#) 

DotNet Core Central
Подписаться 27 тыс.
Просмотров 12 тыс.
50% 1

Reflection is a feature of .NET which helps reflect an assembly and its types. We can use reflection to dynamically browse through all the types defined inside of an assembly.
Apart from just browsing through the assembly for its types, we can also create an instance of the types inside of the assembly. We use the Activator class for creating an instance from a type.
We can also invoke the methods, set properties, and fields using reflection. One fundamental difference between calling methods using reflection compared to the normal way of creating a class and calling is the method, is that using reflection, we can even call the private methods. We can even access private fields and properties using reflection.
Using reflection, we can call both static and instance members.
In this video, I am going to create an assembly, with a single class. And inside of the class, I will define multiple methods, of different varieties. Starting from a method with parameters, a method without parameter, method returning value, and method without any return. I will also have a static and an instance property.
And finally using reflection, I will create an instance of the type. And then I will first initialize the private field of the class. And finally, call all the methods and properties of the type on the instance.
The source code of the demonstration is available in GitHub here: github.com/cho...

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@GBSCronoo
@GBSCronoo Год назад
Thank you very much for the clear explanation, I found a lot of other videos rambling but this one got it in my head.
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks for watching!
@codewithgilly
@codewithgilly 9 месяцев назад
Great stuff
@Dugz
@Dugz 2 года назад
Very clear video, easy to follow and understand the purpose of Reflection. Thank you very much. It would be interesting as a follow up video if you were to demonstrate a real life use case of C# Reflection perhaps in an existing project rather than just demonstrating with console apps.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks for watching!
@testingtesting400
@testingtesting400 4 года назад
Thanks for the video.
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
Thanks for watching!
@bhanukiran5089
@bhanukiran5089 2 года назад
Understood well. Thank you🌹
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@bhanu kiran, thanks for watching!
@houssemayedditlakhal218
@houssemayedditlakhal218 3 года назад
Thank you for the video
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@HOUSSEM AYED DIT LAKHAL, thanks for watching!
@enverendroit1294
@enverendroit1294 3 года назад
thanks a lot
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@enver endroit thanks for watching!
@srinathreddy4384
@srinathreddy4384 2 года назад
Very well explained. Could you please give your name.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Srinath Reddy, thanks for watching! My information is available here: dotnetcorecentral.com/about-net-core-central/
Далее
See It In Action! C# Reflection for Beginners
11:33
Просмотров 2,5 тыс.
НЕДОВОЛЬНА УСЛУГОЙ #shorts
00:27
Просмотров 20 тыс.
IEnumerable VS IQueryable (in .NET Core)
10:52
Просмотров 11 тыс.
C# Reflection Explained (Claim generation example)
39:58
IDisposable Design Pattern (.Net Core)
12:29
Просмотров 11 тыс.
Making async code run faster in C#
10:28
Просмотров 106 тыс.
C# - Reflection | In Hindi
29:57
Просмотров 571