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

Support ComplexType #96

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@karataliu
Contributor

karataliu commented Jun 18, 2015

Issue #86

Add support for complex type, in model building and deserialization.

MetadataWorkspace efModel,
EntityType efEntityType,
EdmModel model,
Dictionary<MetadataItem, IEdmElement> elementMap,

This comment has been minimized.

@congysu

congysu Jun 21, 2015

Contributor

Is IDictionary enough?

This comment has been minimized.

@rayao

rayao Jun 25, 2015

Contributor

Since these are private methods, maybe better to use concrete type for maximized performance?

This comment has been minimized.

@karataliu

karataliu Jul 6, 2015

Contributor

yeah, those are private implementations.. I think Dictionary is fine, but considering we may replace the impl with ConcurrencyDictionary here, I'm to update it to IDictionary now.

private static IEdmTypeReference GetTypeReference(
EdmProperty efProperty,
EdmModel model,
Dictionary<MetadataItem, IEdmElement> elementMap)

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

IDictionary?

private static IEdmComplexTypeReference GetComplexTypeReference(
EdmProperty efProperty,
EdmModel model,
Dictionary<MetadataItem, IEdmElement> elementMap)

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

IDictionary, and others.

@@ -0,0 +1,35 @@
using System;

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Add a license header.

This comment has been minimized.

@karataliu

karataliu Jul 6, 2015

Contributor

added

[Fact]
public async Task ComplexTypeUpdate()
{
var libraryDomain = new LibraryDomain();

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

// Arrange
// Act
// Assert

@@ -0,0 +1,29 @@
using System;

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Add license header.

This comment has been minimized.

@karataliu

karataliu Jul 6, 2015

Contributor

added

public class ModelBuilderTest
{
[Fact]
public void ComplexTypeShoudWork()

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

ComplexTypeShouldWork, and AAA.

var model = Domain.GetModelAsync(new LibraryDomain().Context).Result;
IEnumerable<EdmError> errors;
Assert.True(model.Validate(out errors));
Console.WriteLine(errors.Count());

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Change WriteLine to Assert

Assert.Equal(2, address.Properties().Count());
}
}

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Remove empty line.

using Microsoft.Restier.Core.Query;
using Microsoft.Restier.Core.Submit;
using Xunit;
namespace Microsoft.Restier.WebApi.Test

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Add an empty line, and license header.

{
public bool TryGetRelevantType(DomainContext context, string name, out Type relevantType)
{
relevantType = typeof(Product);

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Do we also need to handle Address?

This comment has been minimized.

@karataliu

karataliu Jul 6, 2015

Contributor

this is only invoked for entity type.

class TestQueryExecutor : IQueryExecutor
{
public Task<QueryResult> ExecuteQueryAsync<TElement>(QueryContext context, IQueryable<TElement> query, CancellationToken cancellationToken)

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

wrap the long line, and the other.

@@ -0,0 +1,12 @@
using System;

This comment has been minimized.

@congysu

congysu Jun 24, 2015

Contributor

Add license header for new files

@karataliu karataliu closed this Jul 6, 2015

@karataliu karataliu deleted the karataliu:cpx branch Jul 6, 2015

@congysu congysu added this to the v0.3 milestone Aug 3, 2015

@karataliu karataliu modified the milestones: 0.3.0-beta1, v0.3 Aug 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment