-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
MigrationsAnnotationProvider.cs
91 lines (75 loc) · 3.71 KB
/
MigrationsAnnotationProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Utilities;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.EntityFrameworkCore.Migrations
{
/// <summary>
/// <para>
/// A base class inherited by database providers that gives access to annotations used by EF Core Migrations
/// when generating removal operations for various elements of the <see cref="IRelationalModel" />.
/// </para>
/// <para>
/// The service lifetime is <see cref="ServiceLifetime.Singleton" />. This means a single instance
/// is used by many <see cref="DbContext" /> instances. The implementation must be thread-safe.
/// This service cannot depend on services registered as <see cref="ServiceLifetime.Scoped" />.
/// </para>
/// </summary>
public class MigrationsAnnotationProvider : IMigrationsAnnotationProvider
{
/// <summary>
/// Initializes a new instance of this class.
/// </summary>
/// <param name="dependencies"> Parameter object containing dependencies for this service. </param>
public MigrationsAnnotationProvider(MigrationsAnnotationProviderDependencies dependencies)
{
Check.NotNull(dependencies, nameof(dependencies));
}
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IRelationalModel model)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(ITable table)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IColumn column)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IView view)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IViewColumn column)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IUniqueConstraint constraint)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(ITableIndex index)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(IForeignKeyConstraint foreignKey)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(ISequence sequence)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRemove(ICheckConstraint checkConstraint)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRename(ITable table)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRename(IColumn column)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRename(ITableIndex index)
=> Enumerable.Empty<IAnnotation>();
/// <inheritdoc />
public virtual IEnumerable<IAnnotation> ForRename(ISequence sequence)
=> Enumerable.Empty<IAnnotation>();
}
}