示例#1
0
        public ActionResult Details(string broadcaster)
        {
            var repo    = new FaceRepository();
            var content = repo.GetForDetailsPage(broadcaster);

            return(View(content));
        }
示例#2
0
        public ActionResult Charts()
        {
            var repo    = new FaceRepository();
            var content = repo.GetForChartsPage();

            return(View(content));
        }
示例#3
0
        public void Setup()
        {
            _keys = GetKeys();
            var client = new MicrosoftCognitiveServicesRepositoryClient();

            _sut = new FaceRepository(_keys, client);
        }
        // GET: Ajax
        public ActionResult GetAnalysedByBroadcaster(string name)
        {
            var repo = new FaceRepository();

            var content = repo.GetForStartPage(name);

            return(Json(content, JsonRequestBehavior.AllowGet));
        }
示例#5
0
        public void CachModul()
        {
            FaceRepository repository = new FaceRepository();
            ÑacheModul     ñacheModul = new ÑacheModul(repository);

            for (int i = 0; i < 5; i++)
            {
                IComondModul <IMyEntity> comondGet = ñacheModul.Ñommand(comondModul.GetComond(typeof(IUser), TypeComond.Get, null));
            }
            Assert.Equal(1, repository.amount(TypeComond.Get));
        }
示例#6
0
        public ActionResult GetGenderRepresentation(string broadcaster)
        {
            if (string.IsNullOrEmpty(broadcaster))
            {
                broadcaster = "SverigesRadio";
            }
            var repo    = new FaceRepository();
            var content = repo.GetForStartPage(broadcaster);

            return(View(content));
        }
示例#7
0
        public void CachModul()
        {
            FaceRepository repository = new FaceRepository();
            СacheModul     сacheModul = new СacheModul(repository);

            for (int i = 0; i < 5; i++)
            {
                IComondModul <IMyEntity> comondGet = сacheModul.Сommand(comondModul.GetComond(typeof(IUser), TypeComond.Get, null));
            }
            if (repository.amount(TypeComond.Get) != 1)
            {
                throw new Exception("CachModul отпровляет много запросов get вместо одного");
            }
        }
示例#8
0
        public async Task <bool> AddUserAsync()
        {
            HttpContext.Request.Headers.TryGetValue("id", out StringValues id);
            HttpContext.Request.Headers.TryGetValue("name", out StringValues name);
            HttpContext.Request.Headers.TryGetValue("password", out StringValues password);

            SpeakerRepository speakerApi           = new SpeakerRepository();
            CreateVerificationProfileModel profile = await speakerApi.CreateVerificationProfile(SpeakerApiKey);

            FaceRepository faceApi = new FaceRepository();
            Person         person  = await faceApi.CreatePerson("authorized", name);

            UserEntity user = new UserEntity(Int32.Parse(id), name, password, profile.VerificationProfileId.ToString(), person.PersonId.ToString(), 0, 0);

            table.AddorReplaceUser(user);

            return(true);
        }
示例#9
0
 public FaceController()
 {
     api = new FaceRepository();
 }
 public FaceRepositoryShould()
 {
     _context        = new MockDataContext();
     _faceRepository = new FaceRepository(_context);
 }