public async Task SetFeedingCategory(int userId, FeedingCategory feedingCategory)
    {
        var user = await context.Users.Include(f => f.FeedingCategory)
                   .FirstOrDefaultAsync(u => u.Id == userId);

        user.FeedingCategory = feedingCategory;
        await context.SaveChangesAsync();
    }
Beispiel #2
0
        public async Task <IActionResult> SetFeedingCategory(int userId, FeedingCategory model)
        {
            await repository.SetFeedingCategory(userId, model);

            return(Ok());
        }