Parameter 'XX' of domain method 'DeleteXXs' must be an entity type exposed by the DomainService.

6 posts, 0 answers
  1. Maher
    Maher avatar
    11 posts
    Member since:
    Jul 2012

    Posted 22 Aug 2012 Link to this post

    Hi,

    I find this problem with the new version of the ORM (2012.2.816.1), everytime when I try to do a reverse mapping.

    For example, I created a Table named "person". I used the Domain Model Wizard then the Domain Service Wizard.
    I compile the solution I get this issue:

    Parameter 'person' of domain method 'DeletePeople' must be an entity type exposed by the DomainService. 
    The entity type can be exposed either directly in a query operation, or indirectly through an association.


    Regards,
    Maher Jendoubi. 
  2. Maher
    Maher avatar
    11 posts
    Member since:
    Jul 2012

    Posted 24 Aug 2012 Link to this post

    I get the same error with VS2010. Is there anyone who get this message?
  3. DevCraft banner
  4. Maher
    Maher avatar
    11 posts
    Member since:
    Jul 2012

    Posted 24 Aug 2012 Link to this post

    Error Unable to load assembly 'poc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)
    ExceptionString:
    System.SystemException: Unable to load assembly 'poc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500) ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
       at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
       at System.Reflection.RuntimeModule.GetTypes()
       at System.Reflection.Assembly.GetTypes()
       at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
       --- End of inner exception stack trace ---
       at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
       at Telerik.OpenAccess.Metadata.MetadataAttributesReader.ReadMetaModel(Assembly assembly)
       at Telerik.OpenAccess.Metadata.AttributesMetadataSource.<>c__DisplayClass1.<FromAssembly>b__0()
       at Telerik.OpenAccess.Metadata.AttributesMetadataSource.CreateModel()
       at Telerik.OpenAccess.Metadata.MetadataSource.GetModelCore(MetadataContainer old)
       at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
       at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()

  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 24 Aug 2012 Link to this post

    Hi Maher,

     Can you please also share with us the code of your domain service? This exception might be caused by several issues with your code.
    For once the problem might be caused by trying to use a class that is not exposed to a given consumer that has not been previously exposed to the consumer itself. In order to expose that class you will need to have a method that is returning an IQueriable of that type.
    Additionally it is possible that the primary key of your class cannot successfully be inferred and you need to mark it with the [Key] attribute so that the class is successfully exposed to the client.

    All the best,
    Petar
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  6. Maher
    Maher avatar
    11 posts
    Member since:
    Jul 2012

    Posted 24 Aug 2012 Link to this post

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using Telerik.OpenAccess;
    using poc.Web;


    #pragma warning disable 1591


    namespace poc.Web
    {    
        [EnableClientAccess()]
        public partial class pocDomainService : OpenAccessDomainService<pocEntitiesModel>
    {
    public pocDomainService() : base()
    {
    }
    public IQueryable<IM_DOSSIER> GetIM_DOSSIERs()

    return this.DataContext.IM_DOSSIERs;
    }       
    public void DeleteIM_DOSSIERs(IM_DOSSIER iM_DOSSIER)
    {
    // This is a callback method. The actual Delete is performed internally.
    }


    public void UpdateIM_DOSSIERs(IM_DOSSIER iM_DOSSIER)
    {
    // This is a callback method. The actual Update is performed internally.
    }


    public void InsertIM_DOSSIERs(IM_DOSSIER iM_DOSSIER)
    {
    // This is a callback method. The actual Insert is performed internally.

    public IQueryable<IM_MALAD> GetIM_MALADs()

    return this.DataContext.IM_MALADs;
    }       
    public void DeleteIM_MALADs(IM_MALAD iM_MALAD)
    {
    // This is a callback method. The actual Delete is performed internally.
    }


    public void UpdateIM_MALADs(IM_MALAD iM_MALAD)
    {
    // This is a callback method. The actual Update is performed internally.
    }


    public void InsertIM_MALADs(IM_MALAD iM_MALAD)
    {
    // This is a callback method. The actual Insert is performed internally.

    public IQueryable<MEDEC> GetMEDECs()

    return this.DataContext.MEDECs;
    }       
    public void DeleteMEDECs(MEDEC mEDEC)
    {
    // This is a callback method. The actual Delete is performed internally.
    }


    public void UpdateMEDECs(MEDEC mEDEC)
    {
    // This is a callback method. The actual Update is performed internally.
    }


    public void InsertMEDECs(MEDEC mEDEC)
    {
    // This is a callback method. The actual Insert is performed internally.

    }
    }


    #pragma warning restore 1591

  7. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 28 Aug 2012 Link to this post

    Hi Maher,

     Is that the entire data service? I cannot see anywhere a Person type? Is it possible that one of the classes you have exposed (IM_DOSSIER , IM_MALAD , MEDEC) has a reference to the person type? If that is the case then you will need to also have a method similar to this:

    public IQueryable<Person> GetPersons()
            {
                return this.DataContext.Persons;
            }
    This is of course in case where the person property is being exposed to the service through a reference property of one of the above mentioned classes.

    All the best,
    Petar
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Back to Top
DevCraft banner