diff --git a/.gitignore b/.gitignore index c2673be..97038c7 100644 --- a/.gitignore +++ b/.gitignore @@ -106,4 +106,6 @@ build/_umbraco applicationhost.config *.Matt.sln -*.TestHarness \ No newline at end of file +*.TestHarness + +.vs/ \ No newline at end of file diff --git a/src/Fluidity/Data/FluidityRepository`T.cs b/src/Fluidity/Data/FluidityRepository`T.cs index a759b70..f1fa361 100644 --- a/src/Fluidity/Data/FluidityRepository`T.cs +++ b/src/Fluidity/Data/FluidityRepository`T.cs @@ -162,7 +162,17 @@ public virtual long GetTotalRecordCount(bool fireEvents = true) object IFluidityRepository.Get(object id, bool fireEvents) { - return Get((TId)TypeDescriptor.GetConverter(typeof(TId)).ConvertFrom(id), fireEvents); + // Check if the specified Identifier type is the same type as the "id" arguement. + // If it is, then we don't need to convert this value. + // Otherwise, we will need to convert the "id" to the specified type. + if(typeof(TId) == id.GetType()) + { + return Get((TId)id, fireEvents); + } + else + { + return Get((TId)TypeDescriptor.GetConverter(typeof(TId)).ConvertFrom(id), fireEvents); + } } IEnumerable IFluidityRepository.GetAll(bool fireEvents) diff --git a/src/Fluidity/Fluidity.csproj b/src/Fluidity/Fluidity.csproj index 0518f0b..7b202bd 100644 --- a/src/Fluidity/Fluidity.csproj +++ b/src/Fluidity/Fluidity.csproj @@ -397,11 +397,11 @@ REM # Copy files REM ################################################# -IF %25ComputerName%25 == MBP13-PC-BC ( +IF %25ComputerName%25 == DESKTOP-ESFKU58 ( IF NOT "$(SolutionDir)" == "*Undefined*" ( -REM xcopy /s /y "$(TargetPath)" "$(SolutionDir)Fluidity.TestHarness\bin" -REM xcopy /s /y "$(TargetDir)Fluidity.pdb" "$(SolutionDir)Fluidity.TestHarness\bin" -xcopy /s /y "$(ProjectDir)Web\UI\*" "$(SolutionDir)Fluidity.TestHarness" +xcopy /s /y "$(TargetPath)" "C:\Users\Matt\Storage\Sandbox\Umbraco\FluidityDemo\FluidityDemo\bin" +xcopy /s /y "$(TargetDir)Fluidity.pdb" "C:\Users\Matt\Storage\Sandbox\Umbraco\FluidityDemo\FluidityDemo\bin" +xcopy /s /y "$(ProjectDir)Web\UI\*" "C:\Users\Matt\Storage\Sandbox\Umbraco\FluidityDemo\FluidityDemo" ) ) diff --git a/src/Fluidity/Web/Models/FluidityEntityBasicModel.cs b/src/Fluidity/Web/Models/FluidityEntityBasicModel.cs index 45ce729..3b2eb04 100644 --- a/src/Fluidity/Web/Models/FluidityEntityBasicModel.cs +++ b/src/Fluidity/Web/Models/FluidityEntityBasicModel.cs @@ -4,6 +4,7 @@ // using System.Runtime.Serialization; +using Fluidity.Extensions; namespace Fluidity.Web.Models { @@ -13,6 +14,9 @@ public class FluidityEntityBasicModel [DataMember(Name = "id", IsRequired = true)] public object Id { get; set; } + [DataMember(Name = "key")] + public object Key => Id?.EncodeAsGuid(); + // Currently hard coding parent id as nuPickers requires passing // a parent id into it's functions even though it may not be used. [DataMember(Name = "parentId")]