开发者

WF4 workflow service and entity framework problem

开发者 https://www.devze.com 2023-02-18 18:20 出处:网络
I\'ve got a project with entity framework model in. This model works , because it is also a source in our wcf ria application. ( server)

I've got a project with entity framework model in. This model works , because it is also a source in our wcf ria application. ( server)

Now i am trying to create a workflow service , but when i return a list of businessrules(object from the model) in a custom activity, i get the following error when i compile :

Error 4 Compiler error(s) encountered processing expression "BusinessRule". Reference required to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, 开发者_开发技巧PublicKeyToken=b77a5c561934e089' containing the base class 'System.Data.Objects.DataClasses.EntityObject'. Add one to your project.

Anyone an idea? I've added the assembly to my web.config, but that does nothing.

public sealed class GetActiveBusinessRulesActivity : CodeActivity<List<BusinessRule>>
{
    // Define an activity input argument of type string
    public InArgument<Customer> Customer { get; set; }

    // If your activity returns a value, derive from CodeActivity<TResult>
    // and return the value from the Execute method.
    protected override List<BusinessRule> Execute(CodeActivityContext context)
    {
        return FilterBusinessRules(Customer.Get(context));
    }

    private List<BusinessRule> FilterBusinessRules(Customer customer)
    {
        var ctxBusinessRules = new AXHintingModuleEntities();


        return ctxBusinessRules.BusinessRules.Where(p => p.Active == true).ToList<BusinessRule>();
    }


I just found it myself. I had to add System.data.objects.dataclasses to list of imports on the xamlx file, although there was no clear reference to it. Thanks anyway.


Did you add a project reference to the System.Data.Entity assembly from the project containing the CodeActivity?


Code activity has not full access for clr, instead of using CodeActivity use NativeActivity

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号