public string SignIn()
        {
            var formCollection = Request.Form;

            formCollection.TryGetValue("login", out var login);
            formCollection.TryGetValue("password", out var password);

            if (AddUserOrCheckPass(login, password))
            {
                if (formCollection.TryGetValue("vendorToken", out var token) && !string.IsNullOrEmpty(token))
                {
                    _vendorInfos.Add(login, new VendorInfo
                    {
                        Token       = token,
                        ModelSeries = new HashSet <string>()
                    });
                }

                var session = _sessionSource.GetSession();
                _sessions.Add(session, login);
                return(session);
            }

            throw new Exception("Users already exist");
        }
Beispiel #2
0
 public void should_be_able_to_use_the_fluent_mappings()
 {
     new PersistenceSpecification <Record>(_sessionSource.GetSession())
     .CheckProperty(x => x.Name, "Luke Skywalker")
     .CheckProperty(x => x.Age, 18)
     .CheckProperty(x => x.Location, "Tatooine")
     .VerifyTheMappings();
 }
Beispiel #3
0
 public void MappingTest1()
 {
     new PersistenceSpecification <Record>(source.GetSession())
     .CheckProperty(r => r.Age, 22)
     .CheckProperty(r => r.Name, "somebody")
     .CheckProperty(r => r.Location, "somewhere")
     .VerifyTheMappings();
 }
Beispiel #4
0
 public void should_be_able_to_get_a_new_session()
 {
     _sessionSource.GetSession();
 }