Coder Social home page Coder Social logo

Comments (9)

thiagolunardi avatar thiagolunardi commented on May 21, 2024

Hi @MKI-Miro

Is it correct to add MVC dependency to Application project?

God no! You Application should not be aware of what kind of client is consuming it - web, mobile, windows, don't care. So, no dependency at all on it. The Application project should be ready to serve any kind of client.

About the SelectListItem...

Actually, this depends on you. You can extend the CustomerViewModel class in you presentation layer and add more properties to it.

You also can - but shouldn't - create the SelectListItem directly at your Razor view.

from equinoxproject.

MKI-Miro avatar MKI-Miro commented on May 21, 2024

but I cannot add SelectListItem to CustomerViewModel.... (because of dependency to MVC)

so what is the solution?

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 21, 2024

You extend it.

At you UI.Web project, create a file /CustomViewModels/MyCustomerViewModel.cs

public class MyCustomerViewModel : CustomerViewModel
{
    public IEnumerable<SelectListItem> CrediCards { get; set; }
}

from equinoxproject.

MKI-Miro avatar MKI-Miro commented on May 21, 2024

but CustomerAppService does not reference UI.Web

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 21, 2024

Ok, we are missing some info here.

What you have right now at your Application.ViewModels.CustomerViewModel?

Can you share the code here?

from equinoxproject.

MKI-Miro avatar MKI-Miro commented on May 21, 2024

nothing :) it was just wondering how to do it. All I have is your code. So maybe you can extend your application with one dropdown.

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 21, 2024

But I already show you that with MyCustomerViewModel sample.

What you didn't get it?

from equinoxproject.

thiagolunardi avatar thiagolunardi commented on May 21, 2024

Can we close your issue, @MKI-Miro ?

from equinoxproject.

EduardoPires avatar EduardoPires commented on May 21, 2024

I think @thiagolunardi helped you, if you have more questions please reopen the issue.

from equinoxproject.

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.