<commit_before>﻿using Foxtrot.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Foxtrot.Controllers
{
    public class ProfileController : Controller
    {
        private ApplicationDbContext db;

        public ProfileController()
        {
            this.db = ApplicationDbContext.Create();
        }
        public ActionResult Details(Guid id)
        {
            var profile = db.Profiles.SingleOrDefault(p => p.Id == id);

            return View(profile);
        }

        public ActionResult Search(string filter)
        {
            var users = db.Profiles
                          .Where(p => p.FirstName.Contains(filter))
                          .Select(p => new EmployeeViewModel
                                           {
                                               Id = p.Id,
                                               FullName = p.FirstName + " " + p.LastName,
                                               Email = p.Email
                                           });

            return Json(users, JsonRequestBehavior.AllowGet);
        }
    }
}<commit_msg>Adding modal for editing of existing employee.  Still need to wire it up.<commit_after>﻿using Foxtrot.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Foxtrot.Controllers
{
    public class ProfileController : Controller
    {
        private ApplicationDbContext db;

        public ProfileController()
        {
            this.db = ApplicationDbContext.Create();
        }
        public ActionResult Details(Guid id)
        {
            var profile = db.Profiles.SingleOrDefault(p => p.Id == id);

            return View(profile);
        }

        public ActionResult Edit(Guid id)
        {
            //var profile = db.Profiles.SingleOrDefault(p => p.Id == id);

            throw new NotImplementedException();

        }

        public ActionResult Search(string filter)
        {
            var users = db.Profiles
                          .Where(p => p.FirstName.Contains(filter))
                          .Select(p => new EmployeeViewModel
                                           {
                                               Id = p.Id,
                                               FullName = p.FirstName + " " + p.LastName,
                                               Email = p.Email
                                           });

            return Json(users, JsonRequestBehavior.AllowGet);
        }
    }
}
{'fraction_non_alphanumeric': 0.0800615858352579, 'fraction_numerical': 0.0, 'mean_word_length': 1.2119148936170212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1069646', 'n_tokens_mistral': 585, 'n_tokens_neox': 573, 'n_words': 140}