Search results

  1. J

    Answered How to Log Out a User After Deleting Record?

    That would depend on circumstances I guess. It's never really been a good idea in anything I've done but I guess there could be circumstances where it was OK. Just don't do things like let the last administrator delete themselves or delete any user if you need to keep associated records.
  2. J

    Answered How to Log Out a User After Deleting Record?

    I think that I misunderstood this question. Are you really allowing a user to delete their own user record? Why would you be able to return to a list of users at all if you're not a user? This seems rather odd to me.
  3. J

    Answered How to Log Out a User After Deleting Record?

    I'd have to test this myself to know whether it would work but I wonder whether you could put an Authorize attribute based Role on every controller. It's may be the case that the user's role(s) is only retrieved once per session but it might be that the role is checked every time such an...
  4. J

    Use of Microsoft.Office.Interop.Outlook

    I then added "examples" as keyword to my search and the first result was this: https://docs.microsoft.com/en-us/office/client-developer/outlook/pia/how-to-get-and-log-on-to-an-instance-of-outlook If you look at the tree on the left, you can see that that is in the "How do I..." section, which...
  5. J

    Use of Microsoft.Office.Interop.Outlook

    I just copied the name of the namespace from your post into a search engine and the documentation for that namespace was the very first result. https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.outlook?view=outlook-pia The second result was the documentation for the...
  6. J

    Question don't want ref dll and exe in same folder.

    For future reference, while a picture may be worth a thousand words, words are still valuable. If you have moved that line of code from the Main method to a static constructor then just say that. As for the explanation, if you set breakpoints on those two methods then you'll see that the...
  7. J

    Resolved How To Override The Runtime System.dll Namespace?

    The documentation for the Object class is here: https://docs.microsoft.com/en-au/dotnet/api/system.object?view=netframework-4.8 Like every type page in that documentation, it states at the top what namespace it's a member of and what assembly it's declared in. What does it say at the top of...
  8. J

    Resolved How To Override The Runtime System.dll Namespace?

    That link appears to be for the System.dll assembly. Assemblies and namespaces are not the same thing. Each assembly can contain types that are members of multiple namespaces and each namespace can have types declared in multiple assemblies. If you select the Namespaces tab and expand the nodes...
  9. J

    Resolved How To Override The Runtime System.dll Namespace?

    No it wouldn't. I've never once looked at the source for the Object class and only rarely done so for other Framework classes. Seeing the code in the Object class execute is not going to help you understand inheritance. I think that the best way to understand the basic principles of inheritance...
  10. J

    Resolved Contravariance Not Working As Tutorial

    Not at all. If you want to override a method then you have to override it. It's that simple. Otherwise they are not the same method but different methods with the same name. That's got nothing to do with contravariance. Contravariance is about accepting a delegate that has parameters that are...
  11. J

    How to use a SQL script to create a database in C#?

    No. Very much no. That's like say that your application would create a text file using Notepad. Notepad is an application for a human user to create, open, edit and save text files. If you're doing it in code, you're not using a separate GUI application to work with text files. Likewise, ADS is...
  12. J

    Question Proper Folder Structure

    One reason we do it that way is that it allows the service layer to be referenced by a web site (MVC) or a web service (Web API). If you build everything into the web site and then you need to have the web site interact with a web service instead, you need to pull all the service and data access...
  13. J

    Question even if the assert fails the execution should carry on

    The point of Assert methods is generally that they throw an exception if the specific condition they are testing is not met. As is always the case, you would need to either catch that exception or ensure that it's not thrown in the first place.
  14. J

    Question Proper Folder Structure

    Speaking in a very general sense, the Model is the data, the View is the UI and the Controller is the logic. In a more specific sense, the Controller should be the PRESENTATION logic and the Model should be the data specifically for the View. You should also have separate business logic, what is...
  15. J

    Question How to Foreach Through ViewModels?

    Note that any member name should indicate what it represents. If you're member is intended to store multiple items in a list then it should not have a singular name notice here: park.HikingTrail = _context.HikingTrails.Where(i => i.ParkId == id).ToList(); that the property on the right is a...
  16. J

    Question Update using Table Adapter

    You do what I said. If you don't want a particular column to change, what value do you think you should provide for it?
  17. J

    Resolved xUnit .net framework project missing VS2019

    https://xunit.net/docs/getting-started/netfx/visual-studio
  18. J

    Question Update using Table Adapter

    You should be using the ID in the WHERE clause as that is presumably the primary key so that's what it's for. You should be using the primary key in the WHERE clause and every other column that can be modified in the SET clause. That said, if you're using a grid, you shouldn't really be saving...
  19. J

    Resolved xUnit .net framework project missing VS2019

    You've been able to use xUnit for a long time but there hasn't been a dedicated project template for long. Given that Microsoft are really pushing .NET Core for new development, whoever create the xUnit .NET Core project template probably thought that it wasn't really worth creating a .NET...
  20. J

    Resolved xUnit .net framework project missing VS2019

    It would have to exist for it to be missing. There is no such project template, which is why you don't see one. You can add project templates yourself though, that you or a third-party created. This looks like something you could use...
Top Bottom