ClearDatabaseSchemaAlways<TContext> Class
An implementation of IDatabaseInitializer<TContext> that will DELETE all resources (e.g. tables, views, functions, and procedures) within a given database schema and re-seed the database regardless of whether the database model has changed. This implementation of IDatabaseInitializer<TContext> is useful if the current user only has permission to access resources within a particular database schema and not the entire database.
Namespace: Microsoft.WindowsAzure.Mobile.Service
Assembly: Microsoft.WindowsAzure.Mobile.Service.Entity (in Microsoft.WindowsAzure.Mobile.Service.Entity.dll)
Inheritance Hierarchy
System.Object
System.Data.Entity.CreateDatabaseIfNotExists<TContext>
Microsoft.WindowsAzure.Mobile.Service.ClearDatabaseSchemaAlways<TContext>
Microsoft.WindowsAzure.Mobile.Service.ClearDatabaseSchemaIfModelChanges<TContext>
Syntax
public class ClearDatabaseSchemaAlways<TContext> : CreateDatabaseIfNotExists<TContext>
where TContext : DbContext
generic<typename TContext>
where TContext : DbContext
public ref class ClearDatabaseSchemaAlways : CreateDatabaseIfNotExists<TContext>
type ClearDatabaseSchemaAlways<'TContext when 'TContext : DbContext> =
class
inherit CreateDatabaseIfNotExists<'TContext>
end
Public Class ClearDatabaseSchemaAlways(Of TContext As DbContext)
Inherits CreateDatabaseIfNotExists(Of TContext)
Type Parameters
- TContext
The type of DbContext.
Constructors
Name | Description | |
---|---|---|
ClearDatabaseSchemaAlways<TContext>() | Initializes a new instance of the ClearDatabaseSchemaAlways<TContext> that will DELETE all resources from the default schema derived from the service name regardless of whether the model has changed. |
|
ClearDatabaseSchemaAlways<TContext>(String) | Initializes a new instance of the ClearDatabaseSchemaAlways<TContext> class with a given schema. |
Properties
Name | Description | |
---|---|---|
Schema | Gets the schema to DELETE all resources from. |
Methods
Name | Description | |
---|---|---|
DeleteAllResourcesFromSchema(TContext) | DELETE all resources from the Schema. |
|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
InitializeDatabase(TContext) | (Overrides CreateDatabaseIfNotExists<TContext>.InitializeDatabase(TContext).) |
|
MemberwiseClone() | (Inherited from Object.) |
|
Seed(TContext) | (Inherited from CreateDatabaseIfNotExists<TContext>.) |
|
ToString() | (Inherited from Object.) |
Remarks
To seed the database create a derived class and override the Seed method.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.WindowsAzure.Mobile.Service Namespace
Return to top