Processing uploaded files is a pretty common web app feature, especially in
business scenarios. You frequently get a request from your users that they want
to be able to do some work on some data in Excel, generate a CSV, and upload it
into the system through your web application.

If files are small enough, or can be processed quickly, its generally fine to
just handle the import within the request. But sometimes you have to do so much
processing, or so much database IO that its impractical to run the import as
part of the upload process: you need to push that work out to a background job
of some sort.

Sometimes you need a little sitecore script to get something done real quick. If
you’ve got it installed, you could reach for Sitecore powershell, and just use
that, but I find the syntax obtuse and the lack of intellisense support to be
limiting.

Usually what I do is just toss what I call a script page into the admin section,
and use it.

Most of the time when I’m building a single page app, I want to use real URLS,
rather than that hash-based nonsense that is generally the default. Most of the
frameworks, (Angular.js, react-router, vue-router) refer to this url mode as
“history” or “html5” mode. They use the relatively recent history API to push
and pop URLs onto the browser’s navigation stack without incuring a full round
trip to the server.

So you get nicer URLs like http://example.com/users/edit instead of
https://example.com/#/users/edit. I don’t like that hash mark.

The downside is that if the user saves a bookmark or sends a link to a friend,
the browser will actually request a resource at /users/edit (browsers don’t
send anything after # in a URL).

You need to configure the web server to respond to that URL by sending back the
html shell that that SPA loads into, otherwise you probably get a 404, and no
one likes that.

It appears to have been almost 2 months since I last sent one of these. My
apologies for the laziness. I’m sure you wait every Friday with bated breath for
a happy little notification in your email client.

Lets talk briefly about a few more new features in C#-7, which you can use today
in VS2017.

Continuing our tour of new features in C#-7, today we come to Pattern Matching.

Pattern matching is a feature of many programming languages that let you test if
the contents of a variable meet a certain shape, or pattern. So you can test if
a variable is of a class, or in some languages, if a variable has certain
properties.

If you’re familiar with the more robust pattern-matching capabilities of a
language like F#, you’d be disappointed with what’s being introduced here, but
this feature is only going to get more powerful and expressive over time.

I’ve been thinking about trying feature folders on a future .NET MVC project
to see how I like it. A feature folder architecture bundles the source code files
together by business domain feature, instead of by what type of file it is.