对MVC或webapi的角度感到困惑,有什么选择? [英] Confused regarding angular with MVC or webapi , what to choose ?

查看:70
本文介绍了对MVC或webapi的角度感到困惑,有什么选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

From few days , i am very much confused about some symptoms that are listed below

Is this your flow ?
1) Angular Service or module calling => MVC Controller Action calling => Web API controller method => Business Method => Data Method => Database Query

or 

2) Angular Service or module calling => Web API controller method => Business Method => Data Method => Database Query

If you are not creating MVC controller and actions then i think doesn't need to MVC project we can directly call "Web API controller method" from "Angular Service or module"

If only Angular project files will be there then what about server side code? 
Is there all logic from JS files? If it is then everyone can access our js files and javascript can be denied by browser.

And last , if possible please suggest some basic building block of an Angular and MVC(if any) combined project structure

Can someone please explain how people are actually doing in big projects(i mean real-world projects).





我尝试过:



试图找到适合的东西



但是不能按照我的困惑得到



What I have tried:

Tried to find something for that

But not able to get as per my confusion

推荐答案

我建​​议使用Web API控制器。在我目前的项目(现实世界中)中,工作流程如下:

I will suggest using Web API controllers. In my current project(real world one) the workflow is like this:
Angular Service => Web API controller method => Business Method => Data Method => Database Query(using Entity framework)





我们也在使用Entity Framework和Code First方法。

为安全起见,我们正在使用JWT身份验证。

希望这对您有所帮助。



We are using Entity Framework and Code First approach also.
For security, we are using JWT authentication.
Hope this is helpful to you to some extent.


这篇关于对MVC或webapi的角度感到困惑,有什么选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆