Search results for query: *

  1. M

    Issue with EF not loading related entities when using Include()

    Thanks for your time looking at this. I have managed to find the issue which was that the specific data class for this entity was using the Include() extension method from System.Data.Entity instead of Microsoft.EntityFrameworkCore. I set up a new console app with the database context and...
  2. M

    Issue with EF not loading related entities when using Include()

    Here are the relevant parts from the context. This is all auto generated via the package manager console command line. All of my other entities are fine and load the relational data when using Include(). public virtual DbSet<StorageRequestsVirtual> StorageRequestsVirtuals { get; set; } public...
  3. M

    Issue with EF not loading related entities when using Include()

    I am using EF with a C# .NET 7 app. For some reason, related entities are not being loaded when using the Include() method: using var db = new ApexImContext(); var test = db.StorageRequestsVirtuals.Include(sr => sr.Reason) .Include(sr => sr.VirtualServer) .Include(sr =>...
  4. M

    Issue with cross threading even when no UI elements are being updated

    I've done away with the InsertTable method from ClosedXML and switched to a loop and manually adding the table data. The issue no longer occurs. There seems to be some element of that method crossing threads even though it should not be modifying the source collection. It was also showing...
  5. M

    Issue with cross threading even when no UI elements are being updated

    Yes the DataGrid is a UI element and the ReportData collection is bound to it. I have removed the use of any additional Threads/Tasks to try and rule things out. Oddly now, if I load the report data in to the collection and update the UI and then try to export, it fails with the same error...
  6. M

    Issue with cross threading even when no UI elements are being updated

    I have a collection in my ViewModel which is: public ObservableCollection<ReportAgentCallSummaryModel> ReportData { get; set; } = new ObservableCollection<ReportAgentCallSummaryModel>(); I am calling a method in a static class that takes this collection as a parameter and then uses ClosedXML to...
  7. M

    Issue with no data being returned from SQL query when a temp table is used

    Issue solved. It was due to the way I was added the parameter for the IN clause. The criteria for that clause is multiple string values and each value has to be it's own parameter. I had created a helper method for this exact reason but hadn't looked at it in a while and thought I was just...
  8. M

    Issue with no data being returned from SQL query when a temp table is used

    Possibly but if I output the query to console and then copy that to SQL Management Studio it works fine. I will have to do some further testing.
  9. M

    Issue with no data being returned from SQL query when a temp table is used

    That method is ok and has not changed with this attempt to improve the speed of the query. If I add a breakpoint I can see that the data reader does not have any rows before that method is called. Oddly I have also amended a different query. The query itself has not changed, I have just...
  10. M

    Issue with no data being returned from SQL query when a temp table is used

    I am trying to improve the speed of a query that pulls data for a report. For some reason the query I have written works perfectly fine in SQL Management Studio and returns the expected data. If I run it from my app it does not return any data. I have tried the following: Wrap query in a...
  11. M

    Help working around circular dependencies

    I have re-designed things so that the service spins up a logger and then tells the logger where to log to. I have also stripped out the loggers dependency on the data methods such as creating the connection string. This info is obtained in the service and passed to the logger when something...
  12. M

    Help working around circular dependencies

    One thing I have tested works but I am guessing it would be bad practice. I create a wrapper class for each service. The wrapper class creates an instance of each utility class that is needed. For each utility class, it's required classes are then set as references from the wrapper. Example...
  13. M

    Help working around circular dependencies

    I am currently in the process of writing some Windows Services to replace logic that is currently done within a WPF app. There will be several service projects and a class library project for utilities/helpers. I am having some issues figuring out the best way to structure the class library...
  14. M

    Set property values for a registered dependency

    I am using the native IOC with .NET 6 as follows: var builder = WebApplication.CreateBuilder(args); // Add busines logic services. builder.Services.AddScoped<BLAccount>(); builder.Services.AddScoped<BLAccountType>(); builder.Services.AddScoped<BLAuditLog>()...
  15. M

    Set property values for a registered dependency

    I have a logger class that is registered in the program.cs class of any asp.net core app. After the user logs in, I would like to set some properties of that class (username etc) so that I don;t have to pass it to the logger every time I need to log an error. Is it possible to set property...
  16. M

    Get string from controller action

    That did the job. Thanks for your help as always.
  17. M

    Get string from controller action

    Apologies, I had that originally but forgot to change it back. I see the following: [object Object]
  18. M

    Get string from controller action

    I am trying to get a string back from a controller action when a user wants to retrieve a password. I have it set up however I'm not sure how to get the returned string from the json data that is returned. Can anyone point me in the right direction? Table row <td class="text-primary">******<i...
  19. M

    Selecting a check box when another checkbox is selected within a table row

    Managed to figure this out and it was surprisingly straight forward. Here are the checkboxes that have an onclick event calling a javascript function: <tbody> @for (int i = 0; i < Model.WalletPermissions.Count; i++) {...
  20. M

    Selecting a check box when another checkbox is selected within a table row

    I have a data table where the rows are created from a list passed to the view in the model. Each row has a checkbox for 'View', 'Add' and 'Edit'. If the 'Add' or 'Edit' checkboxes are selected then I would like to have the 'View' checkbox selected as it is a dependent permission. I can do...
Back
Top Bottom