Thanks for explaining the reason why you've stored the interfaces in the Domain. This makes a lot of sense and agree it's a much better to move the dependency away from a concrete API implementation - will be changing my current project's structure to match.
All this is new for me, I hope to be able to carry out my own project at the end of this course. Thanks for giving away such good material, my best wishes to the author.
Sean, Thank you for these videos. I've been learning C# and just getting my feet wet with WPF. I am more versed in C++ Win32 and this is a huge lift for me to switch my approach. It is all still confusing since I'm still new to c#, OOP, WPF, Entity Framework, Dependency Injection, etcetera... I've spend a lot of hours going over your videos and following along as you develop this project. I've been trying to implement some of these concepts to refactor an old Win32 app that I have wanted to re-write for a while. I can't thank you enough this has been very helpful and my re-write is going surprisingly well so far. I'm beginning to really like the WPF UI now that I've been able to make a few things work which is just enough of a push to keep learning.
That's wonderful to hear, wade ray! Best of luck on your learning journey. I also started my WPF journey by porting Win32 apps to WPF, and it's definitely a satisfying experience!
Hi, I was wondering if setting Price in StockPriceResult to double? would be an ok alternative. I tried it out and the json deserialization seemed to work ok. that way an exception could be thrown on null instead of zero. Zero would most likely never be a realistic price, so it should reliably be used as an exception... but this idea might be usable in a different use case for a different type of API call where 0 is acceptable. Do you know of any pitfalls in using it? thx for another great episode. :-)
Hey JC, I'm not aware of many pitfalls with using nullable properties. I think they are actually most appropriate when querying data, such as from an API or database, so this use case would definitely apply :)
Is there a way to make your API calls return a single Json object instead of an array? I'm only getting arrays returned and its causing errors with Newtonsoft.
Correct Jack! I suppose I wasn't worried about precision too much for these tutorials. Additionally, I'm not sure if the API returns precise monetary values, so double might be sufficient. In the long run, it'd be smarter to use decimal though. Great suggestion!
I have been trying to figure this out for the last few weeks and you have made these videos just in time! If you could show how to get the financial statements like the balance sheet from the Json links into a table that would be fantastic! I've yet to find a solution... Great video!
Hello James, I'm glad I was able to help. At the moment, I have other things planned before getting into company financial statements. I took a look at the endpoint for financial statements, and it should be straightforward to deserialize the JSON into a model that has a property for a list of "Financials". As for displaying the data, have you looked into the DataGrid control for WPF? I think that would be a good start for your use case. If you're looking for a more advanced control, I would suggest a GridView inside of a ListView.
Thank you for this tutorial. Why you createing classes for every method , like Sellstock service, Buystock service, wt about to have Stock service. It might end up with enormous number of classes when making real application
Great series so far. My client requirement is Apply clean Architecure In wpf Application. Would you please make a video to clarify clean architecture - Interface Business Rule, Application Business Rule, Interface Adapter, Framework and Drivers?
Not traditional but 4 Layered: Domain, Application, Presentation , and Infrastructure. Application Core Types includes Interfaces, Services, DTO (Data Transfer Objects) and Entities (Business Models). Infrastructure Types includes EF Core types (DbContext, Migration), Data access implementation types (Repositories), Infrastructure-specific services (for example, FileLogger or SmtpNotifier). User Interface Types includes Controllers, Filters, Views, ViewModels, Startup Tests Types includes Unit Tests, Integration Tests
Hi, Your solution provided is clearly the best call for Providing a User-Friendly name display for the Index cards, since it's provided through the API return. Using the enum values at first however, reminded me of a C# trick where you can provide a string annotation to the enum, and call on that string as a value instead of the actual enum. I've used this solution before when I needed spaces and special characters. It boils down to basically adding an extension method to your project and calling it against the enum value. I found the solution here: www.codementor.io/@cerkit/giving-an-enum-a-string-value-using-the-description-attribute-6b4fwdle0 just food for thought. Thank you.
Hey JC, I think I have actually used that extension in previous projects. It's a little bit funky in XAML since I think it needs to be tied to a WPF converter, if I recall correctly. But we're definitely lucky the API gives us user friendly names so that everything stays simple.
I used bindings a lot of times, but I am unaware of FallbackValue. I am learning new things every day from you. Thanks Sean.
Hey Sivakumar, glad to hear you're learning!
Bundle of Thanks Sean!!!
This valuable series of yours has turned out to be a Great Treasure for sure!
Thanks for explaining the reason why you've stored the interfaces in the Domain. This makes a lot of sense and agree it's a much better to move the dependency away from a concrete API implementation - will be changing my current project's structure to match.
Definitely a good practice, glad you see the benefit in that Thomas!
All this is new for me, I hope to be able to carry out my own project at the end of this course.
Thanks for giving away such good material, my best wishes to the author.
Sean, Thank you for these videos. I've been learning C# and just getting my feet wet with WPF. I am more versed in C++ Win32 and this is a huge lift for me to switch my approach. It is all still confusing since I'm still new to c#, OOP, WPF, Entity Framework, Dependency Injection, etcetera... I've spend a lot of hours going over your videos and following along as you develop this project. I've been trying to implement some of these concepts to refactor an old Win32 app that I have wanted to re-write for a while. I can't thank you enough this has been very helpful and my re-write is going surprisingly well so far. I'm beginning to really like the WPF UI now that I've been able to make a few things work which is just enough of a push to keep learning.
That's wonderful to hear, wade ray! Best of luck on your learning journey. I also started my WPF journey by porting Win32 apps to WPF, and it's definitely a satisfying experience!
Hi, I was wondering if setting Price in StockPriceResult to double? would be an ok alternative. I tried it out and the json deserialization seemed to work ok. that way an exception could be thrown on null instead of zero. Zero would most likely never be a realistic price, so it should reliably be used as an exception... but this idea might be usable in a different use case for a different type of API call where 0 is acceptable. Do you know of any pitfalls in using it? thx for another great episode. :-)
Hey JC, I'm not aware of many pitfalls with using nullable properties. I think they are actually most appropriate when querying data, such as from an API or database, so this use case would definitely apply :)
Thanks Sean. Update the API endpoint for real time stock prices can be access only by premium members
Is there a way to make your API calls return a single Json object instead of an array? I'm only getting arrays returned and its causing errors with Newtonsoft.
Minor question, and you might cover this later, but isn't it better to use decimal instead of double for monetary calculations?
Correct Jack! I suppose I wasn't worried about precision too much for these tutorials. Additionally, I'm not sure if the API returns precise monetary values, so double might be sufficient. In the long run, it'd be smarter to use decimal though. Great suggestion!
Very valuable instructions. But highly recommend move to UWP since Windows on ARM is the real future now
I have been trying to figure this out for the last few weeks and you have made these videos just in time! If you could show how to get the financial statements like the balance sheet from the Json links into a table that would be fantastic! I've yet to find a solution... Great video!
Hello James, I'm glad I was able to help. At the moment, I have other things planned before getting into company financial statements. I took a look at the endpoint for financial statements, and it should be straightforward to deserialize the JSON into a model that has a property for a list of "Financials". As for displaying the data, have you looked into the DataGrid control for WPF? I think that would be a good start for your use case. If you're looking for a more advanced control, I would suggest a GridView inside of a ListView.
Thank you for this tutorial. Why you createing classes for every method , like Sellstock service, Buystock service, wt about to have Stock service. It might end up with enormous number of classes when making real application
Hi Thanks for the video. Can you please continue videos on Custom control development?
Of course Vinay! I still have a lot more planned for that series
Hey!
Great series so far... Is there more to come?? eagerly waiting.
No worries tushar! Many more videos are planned and coming soon.
Great series so far. My client requirement is Apply clean Architecure In wpf Application. Would you please make a video to clarify clean architecture - Interface Business Rule, Application Business Rule, Interface Adapter, Framework and Drivers?
Hi Mohammad, thank you for watching. For clean architecture, are you referring to traditional design patterns?
Not traditional but 4 Layered: Domain, Application, Presentation , and Infrastructure.
Application Core Types includes Interfaces, Services, DTO (Data Transfer Objects) and Entities (Business Models).
Infrastructure Types includes EF Core types (DbContext, Migration),
Data access implementation types (Repositories),
Infrastructure-specific services (for example, FileLogger or SmtpNotifier).
User Interface Types includes Controllers, Filters, Views, ViewModels, Startup
Tests Types includes Unit Tests, Integration Tests
apparently even thou stock can be 0 is not 'tradable'.
Hi, Your solution provided is clearly the best call for Providing a User-Friendly name display for the Index cards, since it's provided through the API return. Using the enum values at first however, reminded me of a C# trick where you can provide a string annotation to the enum, and call on that string as a value instead of the actual enum. I've used this solution before when I needed spaces and special characters. It boils down to basically adding an extension method to your project and calling it against the enum value. I found the solution here: www.codementor.io/@cerkit/giving-an-enum-a-string-value-using-the-description-attribute-6b4fwdle0 just food for thought. Thank you.
Hey JC, I think I have actually used that extension in previous projects. It's a little bit funky in XAML since I think it needs to be tied to a WPF converter, if I recall correctly. But we're definitely lucky the API gives us user friendly names so that everything stays simple.