CQRS.Tests.KeyValueStorage.Sql.SqlDocumentDbTests.InsertUsersInOtherAppDomain C# (CSharp) Method

InsertUsersInOtherAppDomain() public method

public InsertUsersInOtherAppDomain ( System.Guid userIds ) : void
userIds System.Guid
return void
        public void InsertUsersInOtherAppDomain(Guid userIds)
        {
            var myDomain = AppDomain.CurrentDomain;
            var otherDomain = AppDomain.CreateDomain("other domain", myDomain.Evidence, myDomain.BaseDirectory, myDomain.RelativeSearchPath,false);

            var otherType = typeof(InsertSomething);
            var userInserter = otherDomain.CreateInstanceAndUnwrap(otherType.Assembly.FullName,otherType.FullName) as InsertSomething;

            userInserter.InsertSomeUsers(_connectionString, userIds);

            AppDomain.Unload(otherDomain);
        }