locked
EF CTP5 and WCF DataServices RRS feed

  • Question

  • Just seen the CTP5 of EntityFramework and I thought it would rock, but it actually sucks!

    I've already encountered a couple of ugly bugs - and could not find any fixes so far :(

    #1 By using the $select operator - an error is thrown 

     

    {

    -error: {

    code: ""

    -message: {

    lang: "en-GB"

    value: "Not Implemented"

    }

    -innererror: {

    message: "Unable to create a constant value of type 'System.Data.Services.Internal.ProjectedWrapper2'. Only primitive types ('such as Int32, String, and Guid') are supported in this context."

    type: "System.NotSupportedException"

    stacktrace: " at System.Data.Objects.ELinq.ExpressionConverter.ConstantTranslator.TypedTranslate(ExpressionConverter parent, ConstantExpression linq) at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) at System.Data.Objects.ELinq.ExpressionConverter.ConditionalTranslator.TypedTranslate(ExpressionConverter parent, ConditionalExpression linq) at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input) at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding) at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SelectTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.IEnumerable.GetEnumerator() at System.Data.Services.Internal.ProjectedWrapper.EnumerableWrapper.GetEnumerator() at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)"

    }

    }

    }

     

    #2 An advanced QueryInterceptor is using the DataContext in order to apply some serious filtering - but with this release the DataContext's connection is closed?!?

    [QueryInterceptor("User")]

    public Expression<Func<User, bool>> Filter_User()

    {

    var db = this.CurrentDataSource;

    return u=u.IsApproved && db.ProjectWorkers.Any(u.UserId);

    }

    The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

    Any ideas why the connection is closed?

     

    Saturday, December 11, 2010 7:02 PM

Answers

All replies