Does Breeze increase the need for DTO single-page applications?

I create my first SPA, and I got to creating a DTO for each of my entities, but I just found a breeze, and it looks like it takes care of serializing your changes into packages with a minimum minimum size to optimize updates / additions / etc. ..

The reason I built the DTO is to “smooth out” my data and limit the amount of data that I put into the wire, but I wonder if I even need this overhead if Breeze takes care of it.

+5
source share
2 answers

DTO. " " . , .

. , 100 . DTO. Breeze ( "expand" ), , .

var query = new breeze.EntityQuery.from('Customers')
           .where('Id', 'eq', 42)
           .expand('orders');

, , "":

var query = new breeze.EntityQuery.from('Customers') // all customers
           .select('id, companyName'); // project into an anonymous 2-property object

DTO -, (, "--- --" ).

, DTO, . (-).

+5

Knockout Angular Breeze, DTO DTO-Mapping, ( ). , DAO, DTO . , , ( ) , 90% . , DTO , , , , . , : -)

(@John @Ward) , , , , , , , , , DTO .

, , DTO DTO-Mapping, , DTO , , , , . , . , DTO, , - . .

DTO DTO , , , , , , . , , , , DTO / , . , DAO, . , DTO, , . ( DAO DTO).

DTOs?

  • () CRUD, , () .

100%, . EF , , , - . ?

, , DTO.

EF ( -):

private IQueryable<News> RestrictFields(IQueryable<News> query)
    {
        return query
            .ToList() // This seemd to be needed, otherwhise I cannot use new News()
            .Select(t => new News()
                {
                    Id = t.Id,
                    Text = t.Text,
                    Title = t.Title,
                    Date = t.Date
                })
            .AsQueryable();
    }

, , EF. , , , (). , EF DAO , DTO . ToList(), AsQueryable(). , , , , , - , , "expand".

, , , , DTO? @John: , , Speakers - (Angular Breeze), , .

, , , DTO , Breeze.

, , , , , , DTO .

,

+1

All Articles