Custom Episerver routes without querystring - IPartialRouter
I will show you how to easily bind parameters to your action methods without using the querystring. I have a page, MyPage, with a action method that looks like this: public async...
View ArticleJOS.ContentJson gets replaced by JOS.ContentSerializer
I've spent some time rebuilding the JOS.ContentJson library from scratch and when doing that I realised that it was kind of dumb to limit the library to only JSON. So I've added the possibility to...
View ArticleFirefox adds charset=UTF-8 when doing POST requests with ajax.
One of our customers reported some issues yesterday, all of a sudden they could not upload images in our custom built admin. They sent along a screenshot and I could see that our API responded with...
View ArticleAsp.net core - Log request/response headers
Recently we deployed a new application to our clients production environment. Their hosting partner uses a API gateway in front of the application that allows them to rate limit calls, load balance the...
View ArticleJOS.ContentSerializer now supports Episerver 11
I've just pushed version 2.0.0 to the nuget feed. The following breaking changes was introduced: Target framework is now set to 4.6.1(same as Epi) Minimum version 11.1.0 of EPiServer.CMS.UI.Core is...
View ArticleJOS.ContentSerializer 3.0 has been released!
New features Support for more built in properties The following properties are now supported out of the box: BlockData bool double ContentArea ContentReference DateTime...
View ArticleCustomizing PropertyHandlers in JOS.ContentSerializer
The problem Imagine the following ContentType: public class PostPage : PageData { .... [Display(Order = 400)] [CultureSpecific] [AllowedTypes(typeof(AuthorBlock))] public virtual ContentReference...
View ArticleHow to configure Episerver to use Active Directory
This is a quick guide showing how to configure Episerver to use Active Directory instead of Multiplexing/WindowsProvider. This is NOT showing how to use Azure AD. Im testing this on a new Alloy site...
View ArticleBeware of Enum.TryParse
What do you think Enum.TryParse will return when running this code? public enum ContactMethod { Unknown = 0, Email = 1, Phone = 2 } var result = Enum.TryParse("10", out ContactMethod contactMethod);...
View ArticleHeadless Episerver? Meet JOS.Epi.ContentApi
I read this blog post by Mathias Kunto where he says that he will leave my beloved library behind and start using the new Episerver Headless API instead. I felt like the picture above :( I couldn't...
View ArticleJOS.Epi.ContentApi updated to version 3.0.0
Thanks to the discussion in the comments on the blogpost written by Johan Björnfot I could simplify the code a lot and remove the HttpModule. Version 3.0.0 is now available on the nuget feed. It's a...
View ArticleI'm going freelance!
I've worked as an consultant ever since I got my first job at Isotop back in 2013. Now it's finally time to take the next step. I've started my own company, JEHO Consulting AB, and I will start...
View ArticleGet dot-notation of C# property/member
The problem Validate incoming API calls and return nice errors if some property failed to validate. Example: public class AuthorInput { public NameInput Name { get; set; } } public class NameInput {...
View ArticleYou're (probably still) using HttpClient wrong and it is destabilizing your...
Required reading before reading this blog post: You're using HttpClient wrong and it is destabilizing your software Introduction All code in this blog post can be found here together with instructions...
View ArticleLet's talk about mapping objects in c-sharp (C#)
Intro In this post I will focus on two things: Why should we map our models (database, external api dtos...) to a different object before exposing the data in a API response? How do we map our models?...
View ArticleASP.NET Core - Protect your API with API Keys
Disclaimer There's a bunch of different ways to handle authentication/authorization. As pointed out here on Twitter by Greg Bair, API keys has some limitations/drawbacks. One problem is that usually...
View ArticleDotnet Core - Filter out specific test projects when running dotnet test
Quick example showing how to exclude tests in a certain project when running dotnet test. The problem I have a solution that contains three different test projects: MyProject.Core.Tests...
View ArticleJOS.ContentSerializer now supports TimeSpan? out of the box
Saw the following post today and decided to update JOS.ContentSerializer to support TimeSpan? properties. The default implementation is really naive: public object Handle(TimeSpan? value, PropertyInfo...
View ArticleDotnet Core ConfigurationProvider for Docker Swarm Secrets
Where I work, we are using Docker Swarm to host our containers. Since we don't like to commit sensitive data to our git repo (API Keys, passwords etc) we are storing that kind of data in something...
View ArticleASP.NET Core - Tips and Tricks - Swagger Part 1
Hi Josef, I am trying to get my swagger to send the x-api-key in its header, but i cant get it to work. Do you maybe know how to connect the swagger authentication to this API authentication method?...
View Article