Questions tagged as 'c#'

2
answers

Does user need to have .NET if I compile using Mono?

Will the user using my application need to have the .NET version on the PC? I saw some topics on the internet talking about this Mono advantage.     
asked by 18.06.2016 / 04:15
2
answers

Scaffold Template Edition MVC. How to get project reference in Solution Folder?

I'm editing the ASP.NET MVC Scaffold T4 templates and I need to get some extra class information. For example, , of the DisplayName class attribute. I found some examples: var env = (DTE)((IServiceProvider)this.Host).GetService(typeof(E...
asked by 04.09.2015 / 16:22
1
answer

How do I go through all the controls in a window in WPF?

Is there any way I can go through all the controls in a window and disable them? For example, make a foreach that disables one by one of the controls. Something like below, only for WPF, not WinForms. private void HabilitarControles(boo...
asked by 31.08.2015 / 14:40
1
answer

Exception DbUpdateException

I'm trying to study EF with Code First. I'm getting this exception at SaveChanges() An unhandled exception of type System.Data.Entity.Infrastructure. DbUpdateException occurred in EntityFramework.dll Additional information: An erro...
asked by 02.09.2015 / 03:26
1
answer

ViewData ["ErrorMessage"] does not appear in view

Hello, I'm new to the C # language and would like to know why my ViewData ["ErrorMessage"] does not appear in my view. Controller: ViewData["ErrorMessage"] = "O e-mail digitado já se encontra registrado em nossa base de dados."; return Redir...
asked by 11.09.2015 / 19:29
1
answer

Make queries using the entity framework

Within my repository EF I have the methods, in method ExcluirRegistro I'm passing a StatusRegistro to the database which indicates that this record is being deleted, so in my methods ListarPorId and ListarTodos I'd li...
asked by 17.09.2015 / 20:33
1
answer

NavigationBar VisualStudio 2013

Today I started a project in C # and realized that in the navigation bar, when I click on a control I'm directed to the .aspx designer, and it does not display the events that the control has as in the VB.Net language. / p> Icanonlygototheeve...
asked by 17.08.2015 / 18:01
3
answers

Validation to verify that the record is being used before deleting

My project's MVC is built into services, controllers, Views, and models. My delete screen works, but when the log is used in other tables it displays this error. The DELETE statement conflicted with the REFERENCE constraint "FK_XYZ". The co...
asked by 19.08.2015 / 21:55
1
answer

A dynamic field for each database record

I have a property called ProductDevelopment where I have several functions and must assign a user to each function. I have an EditorTemplate to return a list of users. I have to dynamically create a field for each function registered in the data...
asked by 18.08.2015 / 17:40
2
answers

Field format for saving time

What field should I use in SQL Server to save a running time? Example: 2Days 23H 47Min 00Sec. If you have an example with Fluent API it will help a lot.     
asked by 23.06.2016 / 04:20