Adding a custom MediaTypeFormatter to your WebAPI project

Adding a custom MediaTypeFormatter to your WebAPI project

This is going to be easy. As many of the other posts of this blog, even this entry is due to an issue I was forced to face, this time with the marvelous IE8 šŸ˜€ In a nutshell, I have a WebAPI project returning some nice json data. Everything works...

2 minute read
How to reference an array of scripts from another script in Unity

How to reference an array of scripts from another script in Unity

Just a quick and dirty tip (actually, more of a reminder for myself), probably there’s a better way but for now it worked for me… Basically in Unity I needed a quick way to reference a list of scripts from another script. The idea is to have a ā€œmainā€ script...

1 minute read
Multilanguage searching with Elasticsearch

Multilanguage searching with Elasticsearch

This time I’ll start directly with the code. Ā First an utility method to create the connection: [csharp] private ElasticClient Connect(IEnumerable contents) { var defaultLanguageCode = ā€œengā€; var uri = new System.Uri(ConfigurationManager.AppSettings[ā€œElasticSearchServerā€]); var settings = new ConnectionSettings(uri).SetDefaultIndex(defaultLanguageCode); var client = new ElasticClient(settings); } [/csharp] And here’s the interesting part: [csharp] public...

1 minute read
Multilanguage indexing with Elasticsearch

Multilanguage indexing with Elasticsearch

This time I’m rambling about Elasticsearch. For those who still don’t know, Elasticsearch is a very interesting search engine based on Lucene. It’s structured to work as a NoSQL databaseĀ and exposes a very niceĀ RESTfulĀ web interface. Ok, that’s enough, let’s get started with the code! The first thing to do is...

2 minute read