-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes and improvements #44
Open
GioviQ
wants to merge
17
commits into
Breeze:master
Choose a base branch
from
GioviQ:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+418
−945
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bd31d78
Fixes and improvements tested on https://github.com/enkodellc/blazorb…
GioviQ e28110f
add missing implemetation of Parameters (with hack)
GioviQ cbfb649
fix instructions order
GioviQ 8823cdd
fix missing TimeSpanConverter
GioviQ 71982ca
parameters escape
GioviQ 592d02d
escape json fix
GioviQ d9e5dab
Fix TimeSpan not found
GioviQ bd6d05f
fix issue with composite keys
GioviQ 487e9f4
ParseOrderByExpression fix
GioviQ 4b337a3
MetadataStore.OnMetadataMismatch in EntityType
GioviQ ddee84d
fix issue with composite keys
GioviQ a19a188
RelatedNavigationProperty null check
GioviQ cd6e12c
DomainException for clear error messages
GioviQ 7c0ef68
from Edm.Time to Edm.TimeSpan
GioviQ e05a171
fix DomainException message
GioviQ 27579ac
MigrationBackup folder deleted
GioviQ 5ac674e
AutoGeneratedKeyType in its own file
GioviQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Breeze.Sharp { | ||
/// <summary> | ||
/// AutoGeneratedKeyType is an enum containing all of the valid states for an automatically generated key. | ||
/// </summary> | ||
public enum AutoGeneratedKeyType { | ||
None = 0, | ||
Identity = 1, | ||
KeyGenerator = 2 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace Breeze.Sharp { | ||
public class DomainException : Exception { | ||
public string Description { get; } | ||
|
||
public DomainException(string message) : base(message) { | ||
|
||
} | ||
|
||
public DomainException(string description, string message) : base(message) { | ||
Description = description; | ||
|
||
} | ||
|
||
public DomainException(string description, string message, Exception innerException) : base(message, innerException) { | ||
Description = description; | ||
|
||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Breeze.Sharp.Core; | ||
using Breeze.Sharp.Core; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
@@ -624,7 +624,7 @@ private void SetDpValueKey(DataProperty property, object newValue, object oldVal | |
|
||
if (this.IsAttached) { | ||
this.EntityType.InverseForeignKeyProperties.ForEach(invFkProp => { | ||
if (invFkProp.RelatedNavigationProperty.Inverse == null) { | ||
if (invFkProp.RelatedNavigationProperty != null && invFkProp.RelatedNavigationProperty.Inverse == null) { | ||
// this next step may be slow - it iterates over all of the entities in a group; | ||
// hopefully it doesn't happen often. | ||
EntityManager.UpdateFkVal(invFkProp, oldValue, newValue); | ||
|
@@ -931,13 +931,14 @@ private bool FixupFksOnUnattached(NavigationProperty np) { | |
var npEntity = GetValue<IEntity>(np); | ||
// property is already linked up | ||
if (npEntity != null) { | ||
if (npEntity.EntityAspect.IsDetached) { | ||
if (npEntity.EntityAspect.IsDetached && np.ForeignKeyProperties.Any()) { | ||
// need to insure that fk props match | ||
var fkProps = np.ForeignKeyProperties; | ||
npEntity.EntityAspect.EntityType = np.EntityType; | ||
// Set this Entity's fk to match np EntityKey | ||
// Order.CustomerID = aCustomer.CustomerID | ||
npEntity.EntityAspect.EntityKey.Values.ForEach((v, i) => SetDpValue(fkProps[i], v)); | ||
//commented because set keys to default values | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ApplicationUser has wrong key as empty Guid Probably you have a better solution. You can use that repo as test. |
||
//npEntity.EntityAspect.EntityKey.Values.ForEach((v, i) => SetDpValue(fkProps[i], v)); | ||
} | ||
return false; | ||
} | ||
|
@@ -1001,7 +1002,16 @@ internal void UpdateRelated(DataProperty property, object newValue, object oldVa | |
// ==> (see set navProp above) | ||
|
||
if (newValue != null) { | ||
var key = new EntityKey(relatedNavProp.EntityType, newValue); | ||
var newValues = new List<object>(); | ||
|
||
foreach (var fKey in relatedNavProp.ForeignKeyProperties) { | ||
if (fKey == property) | ||
newValues.Add(newValue); | ||
else | ||
newValues.Add(GetValue(fKey)); | ||
} | ||
|
||
var key = new EntityKey(relatedNavProp.EntityType, newValues.ToArray()); | ||
var relatedEntity = EntityManager.GetEntityByKey(key); | ||
|
||
if (relatedEntity != null) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to setup in Blazor project BaseAddress externally.
Look also https://github.com/enkodellc/blazorboilerplate/blob/development/src/Tests/BlazorBoilerplate.IdentityServer.Tests/Program.cs