RobThree / MongoRepository

Repository abstraction layer on top of Official MongoDB C# driver
https://www.nuget.org/packages/MongoRepository/
MIT License
307 stars 141 forks source link

Post data and Entity inherit #10

Closed dalton5 closed 9 years ago

dalton5 commented 9 years ago

Hi, I have created a model that inherits from Entity. And one that does not inherit from Entity.

The model that inherits from Entity instantiate the object but does not fill the property in the post request. See screenshots.

My model is like this:


public class EmailTransac : Entity
    {   [Required()]
        public string Name { get; set; }
        [Required()]
        public string From { get; set; }
        [Required()]
        public string Template { get; set; }
        [Required()]
        public string Subject { get; set; }
    }

    public class EmailTransacModel
    {
        [Required()]
        public string Name { get; set; }
        [Required()]
        public string From { get; set; }
        [Required()]
        public string Template { get; set; }
        [Required()]
        public string Subject { get; set; }
    }

With inherit of Entity

2015-08-22 17_45_58-gleamr debugging - microsoft visual studio administrator

Without inherit of Entity

2015-08-22 17_47_03-gleamr debugging - microsoft visual studio administrator

My Postman config

2015-08-22 17_47_29-postman

Any ideas how can I fix this?

Thanks,

RobThree commented 9 years ago

I kindly request you post questions on Stackoverflow or similar sites. This github repository contains code and actual issues with the MongoRepository code (not using it) and is not intended for support.

dalton5 commented 9 years ago

Ok.

Post for the question on stack

http://stackoverflow.com/questions/32158737/mongorepository-post-data-and-entity-inherit-is-property-empty