<commit_before>using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;

using XamList.Backend.Shared;

namespace XamList.Functions
{
    public static class RestoreDeletedContacts
    {
        [FunctionName(nameof(RestoreDeletedContacts))]
        public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "RestoreDeletedContacts/")]HttpRequestMessage req, ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            try
            {
                var contactModelList = XamListDatabase.GetAllContactModels();
                var deletedContactModelList = contactModelList.Where(x => x.IsDeleted);

                var undeletedContactModelList = deletedContactModelList.Select(x =>
                {
                    x.IsDeleted = false;
                    return x;
                }).ToList();

                foreach (var contact in undeletedContactModelList)
                    await XamListDatabase.PatchContactModel(contact).ConfigureAwait(false);

                return new OkObjectResult($"Number of Deleted Contacts Restored: {undeletedContactModelList.Count}");
            }
            catch (System.Exception e)
            {
                log.LogError(e, e.Message);
                throw;
            }
        }
    }
}<commit_msg>Update RestoreDeletedContacts.cs<commit_after>using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;

using XamList.Backend.Shared;

namespace XamList.Functions
{
    public static class RestoreDeletedContacts
    {
        [FunctionName(nameof(RestoreDeletedContacts))]
        public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "RestoreDeletedContacts/")]HttpRequestMessage req, ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            try
            {
                var deletedContactModelList = XamListDatabase.GetAllContactModels(x => x.IsDeleted);

                var undeletedContactModelList = deletedContactModelList.Select(x =>
                {
                    x.IsDeleted = false;
                    return x;
                }).ToList();

                foreach (var contact in undeletedContactModelList)
                    await XamListDatabase.PatchContactModel(contact).ConfigureAwait(false);

                return new OkObjectResult($"Number of Deleted Contacts Restored: {undeletedContactModelList.Count}");
            }
            catch (System.Exception e)
            {
                log.LogError(e, e.Message);
                throw;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08449767132401863, 'fraction_numerical': 0.0, 'mean_word_length': 2.275599128540305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2555117', 'n_tokens_mistral': 778, 'n_tokens_neox': 768, 'n_words': 154}