Inquiry about c # mvvm and patterns [closed]

0

For a while now I've been looking at c# , mvvm and wpf , and every time I get more into the subject I also lose more. I clarify that I love how the mvvm works and the theme of undocking things.

I have read that it should be implemented (eg for a detail invoice), pattern repository y unit of work , also implement ioc and dependency injection, read and watch videos on the network and more or less understand but most of the explanations they are separate and in mvc . Then I do not know how to implement it in an application really.

Then I see in this link :

  • DbContext: It will be the object that will group all the elements of our conceptual model and will handle the mapping of each of them with their pair in the database, incorporating the work unit pattern and the repository pattern.

  • DbSet: Commonly used as a property type within a class that inherits from the DbContext type, it receives a generic type which represents an entity of our domain, thus enabling CRUD operations for the specified entity .

Then I say: "I do not need to create the repository or the unitofwork", what to do? and how?.

Is there an explanation that brings together several of these things and you can see some real application or how do you implement it?

The truth that I've been wanting for a while now to make a little program wpf but using good practices, but I do not find it back and I'm getting tired and I think it's worth it.It will not be better to do it as before with the style visualfox and chauu .

Thanks and regards.

Federico

    
asked by Federico 28.12.2016 в 23:44
source

1 answer

0
  

MVVM, is a design pattern that is implemented in the layer of   presentation, used in WPF, Windows Phone, etc.

Check out this Link WPF MVVM step by step ( Basics to Advance Level)

  

IoC, is a design pattern that reduces encoded dependencies   between your classes, eliminating those dependencies will allow our   code is much more maintainable, extensible and testable and allows   inject functionalities to business entities.

There are several IoC frameworks I can recommend. Ninject is the one I usually use.

Check this link on how to configure Ninject in WPF How to use Ninject in WPF application

Federico: Then I say: "I do not need to create the repository or the unitofwork", what to do? and how?.

  

If you are going to use an ORM that allows you to map our data model to   our objects and class structure of our application,   achieving with this solve the access and persistence of data without much   effort and being able to focus on what really matters to us, the   business domain. In that case, if I would recommend implementing the    pattner Repository , the pattner UnitOfWork serves to abstract the persistence, everything depends on what you want to do.

    
answered by 29.12.2016 / 04:22
source