1

Closed

I have no OrderSet Propertys

description

Ok first of all I switched to DbContext to make it all a little easier, and server side code compiled OK.
Client side did not work until I changed both ICollection<ProductOrder> to have the same name like so:
namespace Test.Web {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web.DomainServices.FluentMetadata;
    using RIAServices.M2M;
    using RIAServices.M2M.Configuration;

    #region ProductOrder

    public class ProductOrder : LinkTable<Product, Order> {

        //[Key]
        //public int ProductId { get; set; }

        //[Key]
        //public int OrderId { get; set; }

    }

    public partial class Product {

        public ICollection<ProductOrder> ProductOrders {
            get {
                return Orders.ProjectObject1(this, x => x.ProductOrders);
            }
        }
    }

    public partial class Order {

        public ICollection<ProductOrder> ProductOrders {
            get {
                return Products.ProjectObject2(this, x => x.ProductOrders);
            }
        }
    }

    public class MetadataConfiguration : IFluentMetadataConfiguration {

        public void OnTypeCreation(MetadataContainer metadataContainer) {
            metadataContainer.Entity<Product>()
                .Projection(x => x.Orders)
                .M2M(x => x.ProductOrders, x => x.ProductOrders, x => x.Products);
        }
    }

    #endregion ProductOrder


}
If I don't name them the same client side code breaks with:

Error 1 'Test.Web.ProductOrder' does not contain a definition for 'AttachProductToOrder_Product_ProductOrders'
Error 2 'Test.Web.ProductOrder' does not contain a definition for 'AttachOrderToProduct_Order_ProductOrders'


Are you aware of this? Or am I missing something?
Closed Oct 8, 2013 at 7:33 AM by MdeJ
Fixed in 785dffadad38, nuget packages have been pushed

comments