Coder Social home page Coder Social logo

Support for DTOs about nhibernate.odata HOT 6 CLOSED

pvginkel avatar pvginkel commented on July 18, 2024
Support for DTOs

from nhibernate.odata.

Comments (6)

pvginkel avatar pvginkel commented on July 18, 2024

I'm not sure if I follow. Do you need to map the field names as they come in from the query string (the parameters to the ODataQuery method)?

from nhibernate.odata.

shaharyr avatar shaharyr commented on July 18, 2024

I will try to explain by example.
I have class DtoA which is public to the users and class DataModelA which is private and is mapped to NHibernate.
Lets say that one of the members in DtoA is called FieldA and DataModelA contains a field called DbFieldA.
The query string will refer to FieldA, but when translating it to the ICriteria, i need this filed to be replaced with DbFieldA (because that is the field that NHibenate knows..)

from nhibernate.odata.

pvginkel avatar pvginkel commented on July 18, 2024

Have a look at this change. This change allows you to provide a custom NameResolver on the ODataParserConfiguration. An example on how to use this can be found in https://github.com/pvginkel/NHibernate.OData/blob/e2e80aea8e8f1a89fabc9ede480c1ca0639cef84/NHibernate.OData.Test/Criterions/NameResolving.cs.

from nhibernate.odata.

shaharyr avatar shaharyr commented on July 18, 2024

I will take a look.
Thanks for the quick reply!!

from nhibernate.odata.

shaharyr avatar shaharyr commented on July 18, 2024

I took the last version and it is exactly what i needed.
Thanks a lot

from nhibernate.odata.

pvginkel avatar pvginkel commented on July 18, 2024

You're welcome.

from nhibernate.odata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.