Using C# Expression Trees in ASP.NET Controllers (A PRACTICAL EXAMPLE)

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 26

  • @ikirachen
    @ikirachen 5 років тому

    Totaly agree. The slow part of the reflection is SetValue. Analizing types and methods is look up over cached values :)

  • @VarunTeja
    @VarunTeja 3 роки тому

    This is amazing, learnt lot of things by this video.

  • @ekashkash
    @ekashkash 4 роки тому

    Awesome presentation. Thank you!

  • @superpcstation
    @superpcstation 5 років тому +2

    Hi, really appreciate that you are taking the time to make these. I have only skimmed through your videos and i have a suggestion. It would be nice if you could speed up the footage at unnecessary parts like loading, launching, writing simple code etc. Thanks for all the effort :)

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому +1

      This is a great idea. I will implement it in the future. Thank you for the feedback! As for now, you can watch the whole video on 1.5 speed fo example.

    • @ЛюбомирГеоргиев-о5й
      @ЛюбомирГеоргиев-о5й 5 років тому +1

      I firmly believe, that showing this "unnecessary parts like loading, launching, writing simple ..." is showing exactly how code was, and should be, written. And when you see how Ivo is also making mistakes and fixing them is more precious than just showing you the final code. If you do not want to see the creation path you can go to ASP.NET project and look around their code.

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому +1

      I believe he is talking about VS loading times and other not useful parts of the video. As for code errors an debugging - I believe they are useful because such errors show how an experienced developer solves problematic code.

  • @TestTest-wl8ep
    @TestTest-wl8ep 5 років тому +1

    if i have a async Action as redirectExpression i get a Warning. How can i remove that warning?

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому +2

      testest jzjgjzgjf I mentioned it in the video at one point - make another overload of the method, which uses Expression instead of the action. I will start uploading the examples in GitHub for easier copy-paste.

    • @TestTest-wl8ep
      @TestTest-wl8ep 5 років тому

      @@CodeItUpByAMBITIONED thank you

  • @zurasamkharadze4388
    @zurasamkharadze4388 4 роки тому +1

    This lecture is also great, but the reason why I am interested in Expressions is that, I want to know how Can I work with expressions in anonymous types linq queries, can you link if you have such lecture, please?

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  4 роки тому

      Can you give me an example of what are you trying ti accomplish, and I will help you (or create a video about it).

    • @zurasamkharadze4388
      @zurasamkharadze4388 4 роки тому +1

      Thank you for your help. Lets say, one recruiter asked me if I knew how to work with a Linq query, Which type is anonymous (not specified type), after that he asked if I ever worked with expressions. From that I want to understand, how can I work with the type of query, which is not specified for me.

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  4 роки тому

      @@zurasamkharadze4388 Is is an anonymous or a generic type, which you do not know during compile time? Because there is a huge difference and in practice - usually anonymous types in the expression trees are not that common.

    • @zurasamkharadze4388
      @zurasamkharadze4388 4 роки тому +1

      @@CodeItUpByAMBITIONED Pardon me, he mentioned generic type, not the anonymous, my mistake...

    • @zurasamkharadze4388
      @zurasamkharadze4388 4 роки тому +1

      I Assume that he asked about this mayby... " var query = context.Groups.GetAll().AsQuerable().Include(a => a.prop).Select(c => ((TypeName)c)) " to cast it with select?

  • @darkened-
    @darkened- 5 років тому +1

    Love your videos, man!
    I have a couple of questions that are "off-topic" but gonna ask you anyways =D
    - What do you think about dotnet Blazor?
    - Is it worth developing a full stack web app at this point?
    - Do you plan to make a video regarding this topic? I think it would be really helpful and awesome!
    Thanks in advance! Keep it up =P

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому +2

      Kristian Bashev Thank you for the nice words. I will do a Blazor video when it is completely ready for production and not in a preview state. For now I prefer using React or Angular for the front-end, but Blazor will be a great way to build SPA applications in the near future. We just need to wait a bit until it is mature enough. I have a friend who is using it in production and he is happy with it, however. It’s a matter of dev recourses and knowledge, but if you like it - go for it!

    • @darkened-
      @darkened- 5 років тому +1

      ​@@CodeItUpByAMBITIONED Thank you for the quick and detailed response, I do really appreciate it!

  • @OvRaf
    @OvRaf 3 роки тому

    perfect

  • @ikirachen
    @ikirachen 5 років тому

    Another thing. Why redirect, wehn we can just call the controller action method ? Yeah it will not be reflected in the browser as 302 redirect, butt we will achieve the same result.

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому +1

      In a lot of situations, you will want to have an actual HTTP redirect. For example, after a form post, you do not want the user to be able to hit refresh and send the data again.

    • @ikirachen
      @ikirachen 5 років тому

      @@CodeItUpByAMBITIONED note accepted :)

    • @CodeItUpByAMBITIONED
      @CodeItUpByAMBITIONED  5 років тому

      Glad I could help! 🙏