-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6330937
commit 9d0a4e1
Showing
15 changed files
with
291 additions
and
54 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/EFCore.Sqlite.Core/Extensions/SqliteComplexTypePrimitiveCollectionBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore; | ||
|
||
/// <summary> | ||
/// SQLite-specific extension methods for <see cref="ComplexTypePrimitiveCollectionBuilder" />. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-modeling">Modeling entity types and relationships</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
public static class SqliteComplexTypePrimitiveCollectionBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Configures the SRID of the column that the property maps to when targeting SQLite. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-spatial">Spatial data</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
/// <param name="primitiveCollectionBuilder">The builder for the property being configured.</param> | ||
/// <param name="srid">The SRID.</param> | ||
/// <returns>The same builder instance so that multiple calls can be chained.</returns> | ||
public static ComplexTypePrimitiveCollectionBuilder HasSrid( | ||
this ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder, | ||
int srid) | ||
{ | ||
primitiveCollectionBuilder.Metadata.SetSrid(srid); | ||
|
||
return primitiveCollectionBuilder; | ||
} | ||
|
||
/// <summary> | ||
/// Configures the SRID of the column that the property maps to when targeting SQLite. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-spatial">Spatial data</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
/// <param name="primitiveCollectionBuilder">The builder for the property being configured.</param> | ||
/// <param name="srid">The SRID.</param> | ||
/// <returns>The same builder instance so that multiple calls can be chained.</returns> | ||
public static ComplexTypePrimitiveCollectionBuilder<TProperty> HasSrid<TProperty>( | ||
this ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, | ||
int srid) | ||
=> (ComplexTypePrimitiveCollectionBuilder<TProperty>)HasSrid( | ||
(ComplexTypePrimitiveCollectionBuilder)primitiveCollectionBuilder, srid); | ||
} |
46 changes: 46 additions & 0 deletions
46
src/EFCore.Sqlite.Core/Extensions/SqliteComplexTypePropertyBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore; | ||
|
||
/// <summary> | ||
/// SQLite-specific extension methods for <see cref="ComplexTypePropertyBuilder" />. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-modeling">Modeling entity types and relationships</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
public static class SqliteComplexTypePropertyBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Configures the SRID of the column that the property maps to when targeting SQLite. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-spatial">Spatial data</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
/// <param name="propertyBuilder">The builder for the property being configured.</param> | ||
/// <param name="srid">The SRID.</param> | ||
/// <returns>The same builder instance so that multiple calls can be chained.</returns> | ||
public static ComplexTypePropertyBuilder HasSrid(this ComplexTypePropertyBuilder propertyBuilder, int srid) | ||
{ | ||
propertyBuilder.Metadata.SetSrid(srid); | ||
|
||
return propertyBuilder; | ||
} | ||
|
||
/// <summary> | ||
/// Configures the SRID of the column that the property maps to when targeting SQLite. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-spatial">Spatial data</see>, and | ||
/// <see href="https://aka.ms/efcore-docs-sqlite">Accessing SQLite databases with EF Core</see> for more information and examples. | ||
/// </remarks> | ||
/// <param name="propertyBuilder">The builder for the property being configured.</param> | ||
/// <param name="srid">The SRID.</param> | ||
/// <returns>The same builder instance so that multiple calls can be chained.</returns> | ||
public static ComplexTypePropertyBuilder<TProperty> HasSrid<TProperty>( | ||
this ComplexTypePropertyBuilder<TProperty> propertyBuilder, | ||
int srid) | ||
=> (ComplexTypePropertyBuilder<TProperty>)HasSrid((ComplexTypePropertyBuilder)propertyBuilder, srid); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.