Questions tagged as 'c#'

1
answer

ASP.NET MVC - Attribute that writes to a View

I need to write a Attribute that writes a mask validation to View. For example, I would like to mark a property in the Model with a [CEP] , write the following in the View: <script type='text/javascript'> $(docu...
asked by 17.03.2014 / 23:59
1
answer

Best Practices for Inserting, Altering, and Deleting with EntityFramework

For deletion of records you may not have, but for Insertion and Amendment I believe there should already be something discussed. The best recommended practice on Insertion and Change is ViewModel's , where you create a view that is appropri...
asked by 26.10.2014 / 16:24
2
answers

Is there an opposite for 'contains'?

I have a list: List<int> lista1 = new List<int>(); lista1.Add(1); lista1.Add(2); lista1.Add(3); List<int> lista2 = new List<int>(); lista2.Add(1); lista2.Add(2); To get from lista1 elements that also exist in...
asked by 12.08.2015 / 21:54
1
answer

What are metadata in C #?

What are metadata in C # / .NET? What are they good for, and how can I use them? I was looking at a template of Visual Studio, and browsing through the files, I came across them.     
asked by 07.01.2016 / 05:04
5
answers

Compress PDF files

There is this PDF Compressor site that compresses files from 300k to 90k , was looking for in Google and I could not find anything related to doing in c# . Does anyone know of an algorithm that does the same thing in C...
asked by 03.07.2015 / 18:44
5
answers

How do I join two results of a query?

I'm developing an application in C # and would like to know how to merge two results from two queries into one. I have the following code: public List<MalaDireta> ObterMalaDireta() { List<MalaDireta> resultado = new List&...
asked by 11.12.2013 / 17:08
5
answers

How to sort list with complex object by one of its properties?

I have a list of objects and I want to sort the list by one of the properties (Desc of string type), how do I do this? public class Foo { public string Desc { get; set; } // Várias outras propriedades } public class Program { sta...
asked by 10.02.2014 / 18:16
1
answer

What is the function of character? in variable type in C #?

I see many third-party codes and I often see the use of the question mark in the variable type. Example: public bool? Status Can anyone explain to me the difference between not having this ? sign in the bool data type.     
asked by 01.08.2014 / 22:33
1
answer

Do replacing strings with Regex slow down than replace?

Let's say I wanted to do something like this question How to convert CamelCase to snake_case in C #? Convert CamelCase to snake_case in C # You had some answers, but I want to highlight these two. Answer 1 string stringSnake =...
asked by 04.07.2016 / 19:10
1
answer

Guidelines for Visual Assets

I'm developing an application for Windows 10 and on the Microsoft website it does not tell you which pattern to adopt for I mage Asset s: Square 44x44 Logo , Store Logo and Badge Logo . The image below is an example where it shows a c...
asked by 07.12.2015 / 00:50