Question: I have a table like this:

![enter image description here](https://i.stack.imgur.com/8VLf9.png)

and what I need is a sum of amounts in given year for given department.

I tried this:

```
SELECT SUM(amount) FROM `spendings` WHERE dept_name='fiz' AND YEAR(date)=2012

```

but it only returns `NULL`. `dept_name` is a `varchar`, `amount` is a `double` and `date` - well, it's a `date`, what a surprise.

What am I doing wrong?

Answer: 
To prevent anyone else from trying to answer this, the answer is that the System.Version class has no public setters on its members. Hence it cannot be de-serialized properly, and remains in its initial state. I had to use my own "Version" class that had publicly-settable members, and that worked fine.
I dont think [Serializable] could be an issue.

Try putting 'Content-Type: application/json' as header from the client side.
Also use [FromBody] attribute like this.

```
[HttpPost]
[ActionName("Details")]
public ServiceDto Get([FromBody]Version version)
{
}

```