Question: I'm looking to change notifications settings for a single application remotely.
I've got the device enrolled into a MDM.
Android device running 6.01.

I can remotely deploy / update apps etc...
However, I want to disable notifications for this. I can't seem to find a hands off approach to doing this.

I'd have to break out of the end user lock down application.
Go to settings
apps
find app
notifications
block
restart device.

Is there a way I can remotely make this change?

Thanks in advance.

Answer: 
I don't know since which version of EFCore it's possible, but there's a simpler single-query alternative now:

```
context.Topic
   .SelectMany(topic => topic.Posts.OrderByDescending(z => z.CreatedDate).Take(1),
        (topic, post) => new {topic.Id, topic.Title, post.Text, post.CreatedDate})
   .OrderByDescending(x => x.CreatedDate)
   .ToList();

```
**I am not sure about version of EFCore it's possible, but you can try something like this:** It will first group by then will select max id and return max id record from each group.

```
var firstProducts = Context.Posts
.GroupBy(p => p.TopicId)
.Select(g => g.OrderByDescending(p => p.id).FirstOrDefault())
.ToList();

```