-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix the sdk version and do not name a ModelType variable "Type"
#5782
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| { | ||
| "projects": ["src", "test/WebSites", "samples"] | ||
| "projects": ["src", "test/WebSites", "samples"], | ||
| "sdk": { | ||
| "version": "1.0.0-preview2-003154" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,9 @@ public static IEnumerable<object[]> ExpressionAndTexts | |
| var Model = new TestModel(); | ||
| var key = "TestModel"; | ||
| var myModels = new List<TestModel>(); | ||
| var models = new List<TestModel>(); | ||
| var modelTest = new TestModel(); | ||
| var modelType = typeof(TestModel); | ||
|
|
||
| return new TheoryData<Expression, string> | ||
| { | ||
|
|
@@ -56,6 +59,18 @@ public static IEnumerable<object[]> ExpressionAndTexts | |
| (Expression<Func<TestModel, TestModel>>)(m => Model), | ||
| string.Empty | ||
| }, | ||
| { | ||
| (Expression<Func<TestModel, int>>)(model => models[0].SelectedCategory.CategoryId), | ||
| "models[0].SelectedCategory.CategoryId" | ||
|
Contributor
Author
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.
|
||
| }, | ||
| { | ||
| (Expression<Func<TestModel, string>>)(model => modelTest.Name), | ||
| "modelTest.Name" | ||
|
Contributor
Author
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.
|
||
| }, | ||
| { | ||
| (Expression<Func<TestModel, Type>>)(model => modelType), | ||
| "modelType" | ||
|
Contributor
Author
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.
|
||
| }, | ||
| { | ||
|
Contributor
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. What happens if the expression uses something from a type or namespace called "Model" e.g
Contributor
Author
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. We'd have to test those cases. But, this goes beyond the reported problem. So we should focus the follow-up discussion on
Contributor
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. Sounds good. |
||
| (Expression<Func<IList<TestModel>, Category>>)(model => model[2].SelectedCategory), | ||
| "[2].SelectedCategory" | ||
|
|
@@ -157,8 +172,8 @@ public static IEnumerable<object[]> EquivalentExpressions | |
| (Expression<Func<TestModel, string>>)(m => value) | ||
| }, | ||
| { | ||
| // These two expressions are not actually equivalent. However ExpressionHelper returns | ||
| // string.Empty for these two expressions and hence they are considered as equivalent by the | ||
| // These two expressions are not actually equivalent. However ExpressionHelper returns | ||
| // string.Empty for these two expressions and hence they are considered as equivalent by the | ||
| // cache. | ||
| (Expression<Func<TestModel, string>>)(m => Model), | ||
| (Expression<Func<TestModel, TestModel>>)(m => m) | ||
|
|
||
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.
This is the SDK version the build downloads. Is it the correct one for the 1.0.3 milestone?
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.
It should be good for now. @JunTaoLuo, we'll need to update the CLI to the version that's shipping in the release (if any). Could you file a tracking item for this?