Which is the “best” data access framework/approach for C# and .NET?

I think LINQ to SQL is good for projects targeted for SQL Server. ADO.NET Entity Framework is better if we are targeting different databases. Currently I think a lot of providers are available for ADO.NET Entity Framework, Provider for PostgreSQL, MySQL, esql, Oracle and many other (check http://blogs.msdn.com/adonet/default.aspx). I don’t want to use standard ADO.NET … Read more

Entity Framework, Navigation Properties, and the Repository Pattern

Generic Repository vs Non-generic Repository Generic repository is not a pattern. Generic repository is just a wrapper. It can be useful for some special scenarios as a base class for specific repositories but in most cases it is just over used and over hyped nonsense. Navigation properties Repository itself should be used with aggregate root. … Read more

Include with FromSqlRaw and stored procedure in EF Core 3.1

Shortly, you can’t do that (at least for SqlServer). The explanation is contained in EF Core documentation – Raw SQL Queries – Composing with LINQ: Composing with LINQ requires your raw SQL query to be composable since EF Core will treat the supplied SQL as a subquery. SQL queries that can be composed on begin … Read more

Developing a simple Windows system tray desktop app to consume a .NET web service

Keep it all in .NET. You can easily write a Windows Forms application to display a tray icon and display notifications as and when something happens in the web service (you’d probably need a timer to do the polling). There are plenty of articles around that will show you how to do this. Here’s one … Read more

How can I cancel Task.WhenAll?

Use TaskCompletionSource<T> to create a task for some asynchronous condition that does not already have an asynchronous API. Use CancellationToken.Register to hook the modern CancellationToken-based cancellation system into another cancellation system. Your solution just needs to combine these two. I have a CancellationToken.AsTask() extension method in my AsyncEx library, but you can write your own … Read more

what is major difference between dotnet publish and dotnet pack

dotnet pack – Produces a NuGet package of your code. That is the key difference – this will enable to publish to http://nuget.org, or to a nuget server that can be pulled down by other developers, or even for use with Octopus Deploy. dotnet publish – Produces a .NET framework-dependent or self-contained application. Keyword is … Read more

BlockingCollection(T) performance

There are a couple of potential possibilities, here. First, BlockingCollection<T> in the Reactive Extensions is a backport, and not exactly the same as the .NET 4 final version. I wouldn’t be surprised if the performance of this backport differs from .NET 4 RTM (though I haven’t profiled this collection, specifically). Much of the TPL performs … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)