Code Monkey home page Code Monkey logo

Comments (3)

davidsheardown avatar davidsheardown commented on September 13, 2024 2

I use automapper which works really well with .NET Core. I am in a rush at the moment, so will try to post an example soon.

But if you search for automapper and .NET Core, that might get you started

from dataaccess_aspnetcore_deprecated.

StevenVandenBroeck avatar StevenVandenBroeck commented on September 13, 2024 1

If you use our generic repositories you can use AutoMapper or an equivalent library to easily copy only the needed fields to a new DTO object, like @davidsheardown said. It's always better to not expose your entities to the client but to copy the data to a DTO object first. Downside to using our generic repositories for this is that you retrieve more fields from the database than the client needs.
If you really only want to retrieve the needed fields from the database, you will have to return a projection with a custom LINQ to Entities query where you only request the needed fields. You will have to make a custom repository for that.

from dataaccess_aspnetcore_deprecated.

m2017atTR avatar m2017atTR commented on September 13, 2024

I started using AutoMapper .
Thanks for help.

from dataaccess_aspnetcore_deprecated.

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.