Category Archives: ASP.NET

Home / ASP.NET
122 Posts

This morning I was updating some Data Models in a project, and noticed, based on my project scheme, that I would have to add a derived BaseRepository class. This is a side-effect of the way I’ve used Ninject for a long time and every IRepository<T> is specified to be a BaseRepository<T>. That pattern is a little annoying, and in some ways, is counter-intuitive when dealing with DI and generics.

More Link

A friend of mine asked me yesterday how one would go about having an AutoMapper configuration such that you have multiple mappings for the same object pairs. This is an interesting situation for which I didn’t have an immediate answer. But, after playing around with AutoMapper a bit, my choice was to utilize a factory to provide multiple IMapper instances.

More Link

I’ve written a fair bit of demos for Angular 2.x/4.x using Plunker. Plunker provides a pretty convenient way to demo Angular concepts, but the fact that the code is rendered in the browser doesn’t make it overly useful for building redistributable, or production, applications. Since many people have asked me how to take some of my demos from Plunker to a Visual Studio project, that’s what I decided to do.

More Link

A while back, I blogged about using Quartz for scheduling jobs. Recently, I needed to make an API that could trigger jobs, and I thought of Quartz. There is a need/desire in this use case to prevent concurrent execution of jobs when the API is accessed and triggers jobs, and I didn’t really want to stack/queue jobs either. Quartz has some nice mechanisms to achieve exactly what I wanted.

More Link

A memory leak can very difficult to isolate. I ran into an interesting one a few days ago. I have a service that makes calls to a SOAP service with a serialized SOAP body from POCO, and it digests/deserializes the Xml response into POCO. However, there was a memory leak that I could not locate.

More Link

In one of my current projects, I needed to render some barcodes. Google has a nice “Code 128” barcode font which makes rendering a barcode in a website pretty easy. However, in this particular application, I wound up needing to render the barcodes as images since the HTML that I render is fed into a PDF creator that doesn’t support font-face CSS stylings.

More Link

In continuing my efforts to process emails in .NET Core, I needed a way to send styled emails with images and such. Previously, I would have manually handled this by replacing text here and there, but using Razor Views seemed like a much better alternative. Considering that the processing would be handled in my domain layer, all of the views would be generated from embedded resources in a class library.

More Link

Earlier, I was dinking around with some base code I wrote for EF 6.x and recently ported over to EF Core. It’s a nice bit of code that can build LINQ expressions for nearly any search/query scenario regardless of the domain models behind the scenes. It utilizes the LINQ Expression libraries and some reflection. The code works fine in EF 6.x, but I ran into a weird issue when building expressions for many-to-many relationships.

More Link