Thank you for the series, Tim! I have been learning a lot and this series has been helping me bridge my theoretical knowledge with real-world practice in software development. My own debugginng when I make mistakes with this project has been enlightening.
Hi Tim, Can't wait for the upgrade to the user management page to be able to set different access levels. Keep it up. Your work is the main online resource for thoroughly understanding how things work and especially how they work and behave together. As a newbie, whenever I look up Microsoft's website I get lost trying to visualize the result. Thanks again for this channel.
Referring to 42:40, Is the user Id supposed to be the same for both TRMData and EFData? I am getting nothing returned exception in the values count maybe because the UserIds are different. During debugging, the UserId for EFData makes it through but the data.UserData returns nothing.
When at the break point, I get "The function evaluation requires all threads to run" when trying to view the roles. Have not been able to find a definitive resolutions....hmmmm
Nice work as always. I have a little note, I think you should set the visibility of (Users) menuItem to be hidden until you login, just like you did with (Account), because that's throwing a (not authorized) exception. Best luck, hope you enjoy your vacation :)
Hi Tim, just one note. The property UserModel.RoleList seems to work with this simpler way, too: return string.Join(", ", Roles.Values); Thanks for your exceptional work!
I have a suggestion for a new video for the series. My suggestion is setting up a CICD pipeline for the wpf part to show how a person can create a process to keep the updates when there are changes. So far, I have not seen any videos that showed it working all the way from the development to the end users getting the updates for an app. This could be a good series to do this to.
Thank you, lovely lesson, best Tutor. Would like to share my thoughts, every lesson I am doing following you, but in the end of lessons when you launch application to check what you did so far, and almost always everything seems works as it should, but in my case I am braking stuff and introduce a bugs which you don't normally have in your lesson. I remember you keep saying practice more, and I am doing. Some time I can't solve my bug few days, but when I let it go, solution may come next day very easy. I know this is lack of experience and practice. All the best, I will try to get before stage 3, would like to follow in real time.
Software development is all about precision, attention to detail. The more you practice and get burned by missing a small detail, the more trained you will be to be careful of those details. Keep at it.
IAmTimCorey, 17:19 - i have an exception here because of Roles in model is null. I fix it by initialize it by new Dictionary in model. Same thing exists at 21:58 not sure why i don't see it at first timecode. Creation of ApplicationUserModel starts at 10:31, 11:00 - changing List to Dictionary and 11:16 you just close it. And 12:45 - instanciating, here i lost it.
I am not sure where you are different than I am. At 12:45, I am instantiating the Dictionary to a new list, like you found you need to do. Only then can you add roles to the list.
Hey, maybe a bit late but. i just figured this out myself. instead of having to type /swagger all the time with testing why didn't you just change the start action of our API to specific page swagger? saves a couple of seconds every time you need to go to swagger and as always! i am enjoying this course to the fullest :D
Hello, I have a question. For getting the users we used a userManager but it seems to me that calling context.Users.ToList() gives the same result. What are the benefits of user a userManager over that?
UserManager is basically a wrapper around the context so that if you change the context source later, you don't have to change all of your code references. It is an abstraction.
Hi, great video !! I want to ask you, what do you think about tuples? When I first read about them I thought that they were great, but nobody seems to use them. I ask you because when you needed to return a user and a role, I thought that would fit in a tuple. Thanks !!
Hey Tim, I've been follwing along this course and I think it's great. However, I would like to know the reasoning why we put the CSV-list in the UserModel instead of doing the conversion from within the UserDisplayViewModel. For me it makes the most sence to manipulate the way you want to display the data in the view model. Cheers for a great course.
That was a judgement call based upon complexity. I could either add a read-only property that transformed the existing data or I could create a new model in the UI and use a tool like Automapper or LINQ to transform all of the records into the new model (and make a copy of that data) in order to do it in the UI layer. I decided the added complexity didn't add enough value to make it worth it and there wasn't a downside for other UIs that might use the library other than they might have a property that they didn't use.
Hello, Thank you for these very informative videos for me. Regarding the user administration part, I added this line in shellview so as not to show the menu if the person does not have the rights: public bool? AdminMenuVisible => loggedInUser.Roles? .Contains ("Admin"); However, is it "clean" enough? Shouldn't I use a design pattern instead? What about the future if I want to add another role that can have access to this part? So shouldn't I use a command like: if (loggedInUser.HasPerm ("showAdministrationMenu")) Thanks in advance if you have time to answer this question :) PS: sorry for my English, I come from France.
Visual studio (for me) defaults to this.myParam = myParam and your appears to default to _myParam = myParam. I did a little hunting and can't seem to find the option for this preference. How do you change this?
You would modify the functionality in the Tools -> Options menu under Text Editor -> C# -> Code Style -> Naming. Add a naming style called fieldName and set the Required Prefix to "_" (no quotes). Set the capitalization to camel Case Name. Apply that style to Private or Internal Field and hit OK. You should be set.
If someone interested how the GetAllUsers() will look like in LINQ (at 16:48), I've got the following: var result = (from user in users select new ApplicationUserModel { Id = user.Id, Email = user.Email, Roles = (from userRole in user.Roles join role in roles on userRole.RoleId equals role.Id select new { userRole.RoleId, role.Name }).ToDictionary(o => o.RoleId, o => o.Name) }).ToList(); Tim was correct, while more 'scientific' and probably more optimized, it does not look very clear for learning purposes.
For those that prefer linq using method format output = users.Select(u => new ApplicationUserModel() { Id = u.Id, EMail = u.Email, Roles = u.Roles.Join(roles, s1 => s1.RoleId, s2 => s2.Id, (s1, s2) => new { a = s1, b = s2 }).ToDictionary(x => x.a.RoleId, x => x.b.Name) }).ToList();
Hi Tim, I’m trying to move EF DB from local server to another (it's where I moved the SQL one). I’ve searched for info and do I understand right, that to do this I need to make a webserver on the dedicated server and update the “api” key in the App.config file? Is there anything else I’m missing?
There is a video in this series on renaming the EF database. If you follow that video, it will show you how to move the EF database (that is essentially what I did when I renamed it). Here is the link to the video: th-cam.com/video/sMPbsA7OTtM/w-d-xo.html
Hi @IAmTimCorey, The Email and RoleList won't show up on the Users Box in the UserDisplayView. I have tried to debug the code but I can't seem to get anywhere, there seems to be data in the Email and RoleList variables but Ill keep trying. I have to check the naming of Binding Email and RoleList but they are correct. I have checked this video a few times but nothing seems to be different. Would you have a suggestion as to why this problem is happening, maybe do you have some different settings or etc? From my fourth debug session the Users Variable contains an empty Firstname, Surname and Email, how do I fix this?
@1mposs1b1e: Did you ever figure this out? I'm having the same problem. I've stepped through and everything seems to be correct, just nothing is displaying.
Thank you for the series, Tim! I have been learning a lot and this series has been helping me bridge my theoretical knowledge with real-world practice in software development. My own debugginng when I make mistakes with this project has been enlightening.
You are welcome.
Hi Tim,
Can't wait for the upgrade to the user management page to be able to set different access levels.
Keep it up. Your work is the main online resource for thoroughly understanding how things work and especially how they work and behave together.
As a newbie, whenever I look up Microsoft's website I get lost trying to visualize the result. Thanks again for this channel.
Awesome!
Referring to 42:40, Is the user Id supposed to be the same for both TRMData and EFData? I am getting nothing returned exception in the values count maybe because the UserIds are different. During debugging, the UserId for EFData makes it through but the data.UserData returns nothing.
Yes, they should be the same I believe. That is the link between the two databases, so that you know that the logged in user can access their data.
@@IAmTimCorey Thanks Tim! fixed now. Just added another database row with matching UserId and Email and now works!
When at the break point, I get "The function evaluation requires all threads to run" when trying to view the roles. Have not been able to find a definitive resolutions....hmmmm
Check out this post: stackoverflow.com/questions/29985150/visual-studio-during-debugging-the-function-evaluation-requires-all-threads-to
@@IAmTimCorey I really appreciate your help.
Same question, thanks for asking.
@@IAmTimCorey Worked, thanks!
(37:00) You can also use:
string.Join(",",Roles.Values);
Not sure if there's any difference in performance.
Sorry for deleting and re-adding the same comment. I thought it wasn't working as expected, but turned out I had a different bug.
I don't believe there is a difference in performance because I believe it is doing the same thing behind the scenes, but you are correct.
Remarkable work for sure buddy!
Matchless till date! Thanks for sharing the valuable knowledge and excellent experience!
Glad you enjoyed it!
Nice work as always.
I have a little note, I think you should set the visibility of (Users) menuItem to be hidden until you login, just like you did with (Account), because that's throwing a (not authorized) exception.
Best luck, hope you enjoy your vacation :)
Thanks for the suggestion. And yes, I've been enjoying my vacation quite a bit.
Hi Tim, just one note. The property UserModel.RoleList seems to work with this simpler way, too:
return string.Join(", ", Roles.Values); Thanks for your exceptional work!
Yep, that would work.
I have a suggestion for a new video for the series. My suggestion is setting up a CICD pipeline for the wpf part to show how a person can create a process to keep the updates when there are changes. So far, I have not seen any videos that showed it working all the way from the development to the end users getting the updates for an app. This could be a good series to do this to.
Thanks for the suggestion. I do have a paid course (Application Lifecycle Design) that covers this but I'll consider it for this course as well.
Thank you, lovely lesson, best Tutor. Would like to share my thoughts, every lesson I am doing following you, but in the end of lessons when you launch application to check what you did so far, and almost always everything seems works as it should, but in my case I am braking stuff and introduce a bugs which you don't normally have in your lesson. I remember you keep saying practice more, and I am doing. Some time I can't solve my bug few days, but when I let it go, solution may come next day very easy.
I know this is lack of experience and practice.
All the best, I will try to get before stage 3, would like to follow in real time.
Software development is all about precision, attention to detail. The more you practice and get burned by missing a small detail, the more trained you will be to be careful of those details. Keep at it.
IAmTimCorey, 17:19 - i have an exception here because of Roles in model is null. I fix it by initialize it by new Dictionary in model. Same thing exists at 21:58 not sure why i don't see it at first timecode. Creation of ApplicationUserModel starts at 10:31, 11:00 - changing List to Dictionary and 11:16 you just close it. And 12:45 - instanciating, here i lost it.
I am not sure where you are different than I am. At 12:45, I am instantiating the Dictionary to a new list, like you found you need to do. Only then can you add roles to the list.
Hey, maybe a bit late but. i just figured this out myself. instead of having to type /swagger all the time with testing why didn't you just change the start action of our API to specific page swagger? saves a couple of seconds every time you need to go to swagger and as always! i am enjoying this course to the fullest :D
Yep, you can do that. The default for new APIs is to do that. I just didn't do it.
Hello, I have a question.
For getting the users we used a userManager but it seems to me that calling context.Users.ToList() gives the same result. What are the benefits of user a userManager over that?
UserManager is basically a wrapper around the context so that if you change the context source later, you don't have to change all of your code references. It is an abstraction.
Hi, great video !! I want to ask you, what do you think about tuples? When I first read about them I thought that they were great, but nobody seems to use them. I ask you because when you needed to return a user and a role, I thought that would fit in a tuple. Thanks !!
I love them. They are new (well, new for the common use cases) so that's why you don't see them tons.
Hey Tim, I've been follwing along this course and I think it's great.
However, I would like to know the reasoning why we put the CSV-list in the UserModel instead of doing the conversion from within the UserDisplayViewModel. For me it makes the most sence to manipulate the way you want to display the data in the view model.
Cheers for a great course.
That was a judgement call based upon complexity. I could either add a read-only property that transformed the existing data or I could create a new model in the UI and use a tool like Automapper or LINQ to transform all of the records into the new model (and make a copy of that data) in order to do it in the UI layer. I decided the added complexity didn't add enough value to make it worth it and there wasn't a downside for other UIs that might use the library other than they might have a property that they didn't use.
almost 100k subscribers. 😊
Yep, getting close. Tell your friends. :-)
Hello,
Thank you for these very informative videos for me.
Regarding the user administration part, I added this line in shellview so as not to show the menu if the person does not have the rights:
public bool? AdminMenuVisible => loggedInUser.Roles? .Contains ("Admin");
However, is it "clean" enough? Shouldn't I use a design pattern instead? What about the future if I want to add another role that can have access to this part? So shouldn't I use a command like:
if (loggedInUser.HasPerm ("showAdministrationMenu"))
Thanks in advance if you have time to answer this question :)
PS: sorry for my English, I come from France.
Visual studio (for me) defaults to this.myParam = myParam and your appears to default to _myParam = myParam. I did a little hunting and can't seem to find the option for this preference. How do you change this?
You would modify the functionality in the Tools -> Options menu under Text Editor -> C# -> Code Style -> Naming. Add a naming style called fieldName and set the Required Prefix to "_" (no quotes). Set the capitalization to camel Case Name. Apply that style to Private or Internal Field and hit OK. You should be set.
First... Tim Corey, you da man!
Thanks!
If someone interested how the GetAllUsers() will look like in LINQ (at 16:48), I've got the following:
var result =
(from user in users
select new ApplicationUserModel
{
Id = user.Id,
Email = user.Email,
Roles =
(from userRole in user.Roles
join role in roles on userRole.RoleId equals role.Id
select new { userRole.RoleId, role.Name }).ToDictionary(o => o.RoleId, o => o.Name)
}).ToList();
Tim was correct, while more 'scientific' and probably more optimized, it does not look very clear for learning purposes.
Thanks for sharing.
For those that prefer linq using method format
output = users.Select(u => new ApplicationUserModel()
{
Id = u.Id,
EMail = u.Email,
Roles = u.Roles.Join(roles,
s1 => s1.RoleId,
s2 => s2.Id,
(s1, s2) => new { a = s1, b = s2 }).ToDictionary(x => x.a.RoleId, x => x.b.Name)
}).ToList();
Any reason for using BindingList instead of ObservableCollection?
BindingList has more features and power: stackoverflow.com/a/4284805/733798
Hi Tim, I’m trying to move EF DB from local server to another (it's where I moved the SQL one). I’ve searched for info and do I understand right, that to do this I need to make a webserver on the dedicated server and update the “api” key in the App.config file? Is there anything else I’m missing?
There is a video in this series on renaming the EF database. If you follow that video, it will show you how to move the EF database (that is essentially what I did when I renamed it). Here is the link to the video: th-cam.com/video/sMPbsA7OTtM/w-d-xo.html
@@IAmTimCorey Thanks a lot! I've missed that video
Hi @IAmTimCorey,
The Email and RoleList won't show up on the Users Box in the UserDisplayView. I have tried to debug the code but I can't seem to get anywhere, there seems to be data in the Email and RoleList variables but Ill keep trying. I have to check the naming of Binding Email and RoleList but they are correct. I have checked this video a few times but nothing seems to be different. Would you have a suggestion as to why this problem is happening, maybe do you have some different settings or etc?
From my fourth debug session the Users Variable contains an empty Firstname, Surname and Email, how do I fix this?
I wonder if your properties don't match the column names in the database. That would cause an issue.
@1mposs1b1e: Did you ever figure this out? I'm having the same problem. I've stepped through and everything seems to be correct, just nothing is displaying.
@1mposs1b1e: I'm having the same problem. everything seems to be correct, just nothing is displaying. did you found the solution?
I got the solution..in my case i made the "BindingList Users" property to private..so no data is displaying and changed to public its displaying data
Thank you
You are welcome.
cool
I am glad you think so.