Questions tagged as 'asp.net-mvc'

2
answers

What is @ in a view and controller?

I program in PHP and am starting to learn how to program in C # ASP.Net MVC, however I have some questions: What is the @ (arroba) serving in both the controller and the view ? What is the purpose of these { get; set; } calls th...
asked by 05.10.2015 / 18:06
1
answer

Do I need to use try / catch throughout a process chain?

Assuming I have a call on my controller layer for a method in the business layer that leads to another method in the data access layer. Should I use try/catch in all of them, just in some or depends? Below, as an example, I'm usin...
asked by 16.05.2016 / 17:06
1
answer

3 layers vs MVC

3 layers: DAL (Where is the model and operations with the bank BLL (Where is the business rule) Presentation (Usually the WEB) An example: DAL public class AlunoBanco { public void InserirAluno(Aluno aluno){ ......
asked by 22.09.2014 / 01:41
1
answer

Encrypt Web.config

I come here with a question regarding ConnectionStrings of Web.config . Seeing that we normally report a form of authentication on ConnectionStrings for the application to access the database. By default, anyone accessing...
asked by 19.03.2015 / 15:06
1
answer

Download image from server memory

I have an Asp.Net MVC project where I generate an image in memory and would like to download it. See a snippet of code: Image imagem = default(Image); using (Bitmap b = new Bitmap(bitmapWidth, bitmapHeight)) { using (Graphics g = Graph...
asked by 01.12.2015 / 18:52
1
answer

How to automatically fill fields when saving object to bank

I have a system, in ASP.NET MVC that implements an audit form, that when a user inserts or updates an object in the database, some information is saved in an audit table automatically. The interface, which I want to implement is: pub...
asked by 02.12.2016 / 00:54
1
answer

How to use the ruleset functionality of FluentValidation in Web API?

I would like to use a FluentValidation feature called ruleset in a Web API project because it does not I want to have to be doing model validation manually every time an action method is called. So I used the FluentValidationModelVali...
asked by 06.01.2016 / 12:31
2
answers

How to implement a "thin"

I'm working on a prototype of an ASP.NET MVC application, where I want to leave my lean controller (with the least amount of code possible) for that, not doing business logic on it, but yes in the business layer. I have the business layer, wh...
asked by 24.11.2015 / 23:30
1
answer

Change the naming pattern of Views that are generated by scaffold

I would like to change the nomenclature in which scaffold generates Views: Default: Create.cshtml Delete.cshtml Details.cshtml Edit.cshtml Index.cshtml I want scaffold to create this: Criar.cshtml Excluir.cshtml Exibir.cshtml Edita...
asked by 03.10.2015 / 20:59
2
answers

Entity Framework - Bank Compatibility

I was reading a article > which demonstrates the method of using the Entity Framework to connect to MySQL database, however, the article demonstrates techniques very different from the ones I use. (MVC). Currently my applications are based...
asked by 13.08.2014 / 15:05