AutoMapping - any changes between RTM and now?

SW's Avatar

SW

14 May, 2010 04:50 AM via web

Hi

I have been using Fluent RTM and the auto mapping feature and only providing overrides when necessary. However since I switched to using the latest flavour so I could take advantage of Effective Filters I am now getting the following errors

The entity 'XYZABC' doesn't have an Id mapped. Use the Id method to map your identity property. For example: Id(x => x.Id).

Currently to fix this I have to provide an override for every entity (which sort fo defeates the point with AutoMapping) - is this behavour expected or a bug?

Thanks for any pointers

Shaun

  1. 2 Posted by SW on 14 May, 2010 05:55 AM

    SW's Avatar

    Okay I can repeat this with the sample auto map project

    if I change the classes to use an Entity object

    public abstract class Entity
    {
        public virtual int Id { get; private set; }
    }
    
    public class Employee : Entity
    {
        // public virtual int Id { get; private set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }
        public virtual Store Store { get; set; }
    }
    

    and repeat for Product and Store then I get the error I reported above.

    If I change the Entity class to be non abstract the demo code works again

    Shaun

  2. 3 Posted by SW on 14 May, 2010 07:25 AM

    SW's Avatar

    okay I can get the thing to work with a protected set

    public abstract class Entity
    {
        public virtual int Id { get; private set; }
    }
    

    Is this expected?

  3. 4 Posted by SW on 14 May, 2010 07:28 AM

    SW's Avatar

    oops sorry I meant

    public abstract class Entity
    {
        public virtual int Id { get; protected set; }
    }
    

    oops again

  4. Support Staff 5 Posted by Paul Batum on 16 May, 2010 08:49 AM

    Paul Batum's Avatar

    Hi Shaun,

    Thanks for letting us know about this one. I've identified the issue and committed a fix to my repository. I'm sending a pull request to James and it should be in the official trunk before long.

  5. Paul Batum closed this discussion on 16 May, 2010 08:49 AM.

  6. James Gregory re-opened this discussion on 16 May, 2010 02:29 PM

  7. Support Staff 6 Posted by James Gregory on 16 May, 2010 02:29 PM

    James Gregory's Avatar

    Paul's change is now in the official codebase.

  8. 7 Posted by SW on 17 May, 2010 12:19 AM

    SW's Avatar

    thanks

  9. Paul Batum closed this discussion on 17 May, 2010 04:41 AM.

Comments are currently closed for this discussion. You can start a new one.