Ejemplo n.º 1
0
        private void CreateUser(TrexCustomer trexCustomer)
        {
            var newUser = new User
            {
                UserName = trexCustomer.CreatorUserName,
                Name     = trexCustomer.CreatorFullName,
                Email    = trexCustomer.CreatorEmail,
            };

            var connectionStringTemplate      = ConfigurationManager.AppSettings["defaultEFConnectionString"];
            var connectionString              = string.Format(connectionStringTemplate, trexCustomer.ConnectionString);
            var entityConnectionStringBuilder = new EntityConnectionStringBuilder(connectionString);

            var entityConnection = new EntityConnection(entityConnectionStringBuilder.ToString());

            var entityContext = new TrexEntities(entityConnection);

            entityContext.Users.AddObject(newUser);
            entityContext.SaveChanges();
        }
Ejemplo n.º 2
0
 public CustomerServices(ITrexContextProvider contextProvider)
 {
     _entityContext = contextProvider.TrexEntityContext;
 }
Ejemplo n.º 3
0
 public Repository(ITrexContextProvider contextProvider)
 {
     entityContext = contextProvider.TrexEntityContext;
 }
Ejemplo n.º 4
0
 public TemplateService(ITrexContextProvider ContextProvider)
 {
     _entityContext = ContextProvider.TrexEntityContext;
 }