-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ODS-6557] Produce resource links when "SerializedData" feature enabl…
…ed (#1188)
- Loading branch information
1 parent
aa35e6e
commit 59c9de1
Showing
70 changed files
with
138,153 additions
and
36,088 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
Application/EdFi.Ods.Common/Extensions/EntityReferenceDataExtensions.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,25 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Licensed to the Ed-Fi Alliance under one or more agreements. | ||
// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | ||
// See the LICENSE and NOTICES files in the project root for more information. | ||
|
||
namespace EdFi.Ods.Common.Extensions; | ||
|
||
public static class EntityReferenceDataExtensions | ||
{ | ||
/// <summary> | ||
/// Indicates whether the supplied object instance's type name matches the pattern used by NHibernate when building | ||
/// proxied objects for lazy loading purposes. | ||
/// </summary> | ||
/// <param name="instance">The entity instance to be evaluated.</param> | ||
/// <returns><b>true</b> if the instance appears to be proxied; otherwise <b>false</b>.</returns> | ||
public static bool IsProxied(this IEntityReferenceData instance) | ||
{ | ||
if (instance == null) | ||
{ | ||
return false; | ||
} | ||
|
||
return instance.GetType().Name.EndsWith("Proxy"); | ||
} | ||
} |
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,37 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Licensed to the Ed-Fi Alliance under one or more agreements. | ||
// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | ||
// See the LICENSE and NOTICES files in the project root for more information. | ||
|
||
using System; | ||
using EdFi.Ods.Common.Models.Domain; | ||
|
||
namespace EdFi.Ods.Common; | ||
|
||
/// <summary> | ||
/// Defines members for obtaining key values and reference data (including Id and Discriminator). | ||
/// </summary> | ||
public interface IEntityReferenceData : IHasPrimaryKeyValues | ||
{ | ||
/// <summary> | ||
/// Gets the schema/entity name of the associated <see cref="Entity" />. | ||
/// </summary> | ||
FullName FullName { get; } | ||
|
||
/// <summary> | ||
/// The id of the referenced entity (used as the resource identifier in the API). | ||
/// </summary> | ||
Guid? Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity | ||
/// when that entity has been derived; otherwise <b>null</b>. | ||
/// </summary> | ||
string Discriminator { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates whether the reference is fully defined. | ||
/// </summary> | ||
/// <returns><b>true</b> if the reference's data is fully defined; otherwise <b>false</b>.</returns> | ||
bool IsFullyDefined(); | ||
} |
Oops, something went wrong.