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...
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...
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 =>...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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>()...
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...
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...
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++)
{...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.