<commit_before>﻿namespace ModernWPF.WebApi.Web.Controllers
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Web.Http;

    using ModernWPF.WebApi.Web.Models;

    public class CompaniesController : ApiController
    {
        private static List<Company> companies = new List<Company> 
        {
            new Company { Id = 1, Name = "Contoso", StockPrice = 10.0 },
            new Company { Id = 2, Name = "Tailspin", StockPrice = 20.0 },
            new Company { Id = 3, Name = "Litware", StockPrice = 30.0 },
        };

        private static int lastId = 3;

        public IEnumerable<Company> Get()
        {
            return companies;
        }

        public Company Get(int id)
        {
            var company = companies.FirstOrDefault(p => p.Id == id);

            if (company == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return company;
        }

        public int Post(Company company)
        {
            company.Id = ++lastId;

            companies.Add(company);

            return company.Id;
        }
    }
}<commit_msg># added some code comments to the WebApi demo<commit_after>﻿namespace ModernWPF.WebApi.Web.Controllers
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Web.Http;

    using ModernWPF.WebApi.Web.Models;

    public class CompaniesController : ApiController
    {
        private static List<Company> companies = new List<Company> 
        {
            new Company { Id = 1, Name = "Contoso", StockPrice = 10.0 },
            new Company { Id = 2, Name = "Tailspin", StockPrice = 20.0 },
            new Company { Id = 3, Name = "Litware", StockPrice = 30.0 },
        };

        private static int lastId = 3;

        // GET api/companies
        public IEnumerable<Company> Get()
        {
            return companies;
        }

        // GET api/companies/{id}
        public Company Get(int id)
        {
            var company = companies.FirstOrDefault(p => p.Id == id);

            if (company == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return company;
        }

        // POST api/companies
        // { "Name":"new company name", "StockPrice":20 }
        public int Post(Company company)
        {
            company.Id = ++lastId;

            companies.Add(company);

            return company.Id;
        }
    }
}
{'fraction_non_alphanumeric': 0.10082063305978899, 'fraction_numerical': 0.010941774130519734, 'mean_word_length': 1.663891779396462, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 11, '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': '6126583', 'n_tokens_mistral': 728, 'n_tokens_neox': 684, 'n_words': 182}