Category Archives: .NET

Microsoft .NET issues and solutions

Mocking Entity Framework to unit test your data services

It’s not easy to write unit tests for services that use DbContext and DbSet<T> classes from Entity Framework (or Entity Framework Core), and there are complex solutions to approach this, like separating the data access layer completely, as I propose in my UnitOfWork-EntityFramework implementation. … Continue reading

Posted in Architecture, C# | Tagged , , , , , , | Leave a comment

Enabling Entity Framework Core 1.1 tools

After I created an ASP .NET Core 1.1 project (Console app) with Visual Studio 2017 to develop a new WebAPI, I wanted to add support for EntityFrameworkCore. Everything was OK, except for the Tools.DotNet package, which I couldn’t add with … Continue reading

Posted in .NET, ASP .NET, Miscellaneous, WebAPI | Tagged , , | Leave a comment

FileUpload in UpdatePanel

Want to include a FileUpload in UploadPanel using Ajax-enabled ASP .NET WebForms? You need to do two things: Set encoding type to the form element to multi-part: <form … enctype=”multipart/form-data”> Add a non-async postback trigger on the UpdatePanel for the button that … Continue reading

Posted in ASP .NET | Tagged , , , , | Leave a comment

Want to learn WPF? Get a book

Originally posted on Sorin Dolha's Blog:
I’ve said it before. In my opinion, WPF is the single contemporary programming technology (disclaimer: among those that I’ve considered myself) that really requires a book to learn it. Otherwise, trying to dig…

Posted in WPF | Tagged , , | Leave a comment

Change notification chaining

Sometimes you want to define a complex container that aggregates other objects and you would like to chain INotifyPropertyChanged notifications upwards. However, it is difficult to write all the code to wrap up everything needed, and often results in code … Continue reading

Posted in .NET, C# | Tagged , , , , | Leave a comment

Naming items

From time to time I find projects with completely inconsistent naming for their items. While I believe naming things – be them source code files, variables, or enum values – is one of the most important things for the long … Continue reading

Posted in C# | Tagged , , , | Leave a comment

Workaround for FrameworkElement.Triggers using Style and resolving issue

Many times it would be so handy to have Triggers available at the root FrameworkElement object type. Yes, the property exists, but it only supports EventTrigger at that level, while many times you’d want a different type of trigger, such … Continue reading

Posted in WPF | Tagged , , , , | 4 Comments