This commit is contained in:
Eugene Sadovoi 2019-03-13 00:35:48 -04:00
Родитель 1e6fcc4efe
Коммит 0ea9b50ed6
5 изменённых файлов: 83 добавлений и 4 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -10,3 +10,6 @@
/api/*.yml
.manifest
/unitycontainer.github.io
/node_modules
/package-lock.json
/yarn.lock

14
.vscode/launch.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Gulp",
"program": "${file}"
}
]
}

49
gulpfile.js Normal file
Просмотреть файл

@ -0,0 +1,49 @@
var fs = require('fs');
var gulp = require('gulp');
var exec = require('gulp-exec');
var browserSync = require('browser-sync');
const config = 'docfx.json';
const server = browserSync.create();
function watched(){
var content = fs.readFileSync(config);
var json = JSON.parse(content);
return json.build.content.reduce(function(flat, section) {
return flat.concat(section.files);
}, []);
};
function reload(done){
server.reload();
done();
}
function serve(done){
server.init({
server: {
baseDir: './unitycontainer.github.io'
}
})
}
function build(){
var reportOptions = {
err: true,
stderr: true,
stdout: true
};
return gulp.src(config)
.pipe(exec('docfx <%= file.name %>'))
.pipe(exec.reporter(reportOptions));
}
const paths = watched();
const watch = () => gulp.watch(paths, gulp.series(build, reload));
exports.default = gulp.parallel(watch, serve);
exports.watch = watch;
exports.serve = serve;
exports.build = build;
exports.develop = exports.default;

13
package.json Normal file
Просмотреть файл

@ -0,0 +1,13 @@
{
"name": "documentation",
"description": "Unity Container Documentation",
"repository": {
"type": "git",
"url": "git+https://github.com/unitycontainer/documentation.git"
},
"devDependencies": {
"gulp": "^4.0.0",
"browser-sync": "^2.26.3",
"gulp-exec": "^3.0.2"
}
}

Просмотреть файл

@ -19,13 +19,13 @@ Automatic constructor selection is performed if no other information is availabl
The Unity container will try to execute the most complex constructor it can provide with appropriate dependencies. In other words, if the container can resolve and/or inject all parameters of the constructor, it will be selected.
### Creating Pipeline
### Creating Build Pipeline
Selection process takes place during the first resolution of a [Type](xref:System.Type) contract. Unity container employs lazy resolution strategy. It will defer pipeline creation until the contract ([RegistrationType and Name](xref:Tutorial.Registration.Metadata)) is requested.
The lazy approach allows registrations to proceed at random order and do not require dependencies to be registered before dependents. As long as all of these are available at the time of resolution Unity does not care in what order they were registered.
### Constructor selection Steps
### Constructor Selection Steps
One of the first steps, when creating a pipeline, is a constructor selection. Constructors are selected in the following order:
@ -46,10 +46,10 @@ One of the first steps, when creating a pipeline, is a constructor selection. Co
The Unity container will select the first successful match and use it as a selection.
> [!WARNING]
> In case when more than one constructor could be matched at the same time, the order and constructor selection can not be guaranteed.
> When more than one constructor could be matched at the same time, the order and constructor selection can not be guaranteed.
> [!NOTE]
> If [Diagnostic](xref:Tutorial.Unity.Diagnostic) extension is enabled, Unity will perform a selection validation and will throw an exception, reporting ambiguous constructors, if more than one constructor can be selected with current configuration.
> If [Diagnostic](xref:Tutorial.Unity.Diagnostic) extension is enabled, Unity will perform a selection validation and will throw an exception, reporting ambiguous constructors, if more than one constructor can be successfully selected with current configuration.
If no constructor could be selected, the container will throw an exception.