Quantcast
Channel: Josef Ottosson
Browsing all 244 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

AWS Lambda + Python + PIP Packages = true

Intro I'm in the process of moving all my stuff from Azure to AWS. One of the things I currently run in Azure is a twitter bot that tweets every hour (it even made the local news a couple of years...

View Article


C# - Sealed and internal - how to use in unit test?

The problem I'm using the Firebase Admin dotnet sdk to send push notifications. They have the following method that allows you to send multiple notifications with one request: public async...

View Article


Customizing 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 Article

Image may be NSFW.
Clik here to view.

Swagger - Tips and Tricks - Part 2

Exclude certain properties from the Swagger UI The problem Sometimes you have some properties on your request model that you don't want to show in the Swagger UI, for whatever reason. The solution I'm...

View Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

Beware 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 Article

Image may be NSFW.
Clik here to view.

Headless 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 Article

JOS.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 Article


Get 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 Article


You'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 TL;DR Don't use .Result. Stream the response instead of storing the whole response in...

View Article

Image may be NSFW.
Clik here to view.

Let'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 Article

Image may be NSFW.
Clik here to view.

ASP.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 Article

Dotnet 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 Article


JOS.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 Article

Dotnet 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 Article


Image may be NSFW.
Clik here to view.

Swagger - Tips and Tricks - Part 1

Appending API Key header from UI automatically 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...

View Article

Image may be NSFW.
Clik here to view.

AWS Lambda + Python + PIP Packages = true

Intro I'm in the process of moving all my stuff from Azure to AWS. One of the things I currently run in Azure is a twitter bot that tweets every hour (it even made the local news a couple of years...

View Article


C# - Sealed and internal - how to use in unit test?

The problem I'm using the Firebase Admin dotnet sdk to send push notifications. They have the following method that allows you to send multiple notifications with one request: public async...

View Article

Image may be NSFW.
Clik here to view.

Swagger - Tips and Tricks - Part 2

Exclude certain properties from the Swagger UI The problem Sometimes you have some properties on your request model that you don't want to show in the Swagger UI, for whatever reason. The solution I'm...

View Article

HttpClient - Error handling, a test driven approach

Intro When I wrote my last blog post about HttpClient (You're (probably still) using HttpClient wrong and it is destabilizing your software) I promised to do a post about error handling since I...

View Article
Browsing all 244 articles
Browse latest View live