Questions tagged as 'c#'

1
answer

How to filter a DataView.RowFilter

I have a DataView and I'm trying to make a filter, where the 'photo' field is different from NULL I tried: dv.RowFilter = "foto <> ''"; But it did not filter. I searched here on StackOver and recommended: dv.RowFilter = "Isnull(...
asked by 07.01.2016 / 17:54
1
answer

What is a class of type "class MyClassExampleT where T: new () {}"?

Is a class ExemploClass<T> class a list? See the example class below: public abstract class MinhaClasseExemplo<T> where T: new() { public T value {get; set;} } What does each part of this expression mean: abstract class M...
asked by 04.01.2016 / 02:12
1
answer

Start application only if a url is running (Online)

I'm starting to try to learn a little bit in the "marra", and I wanted to know if I have to do some code that checks if a specific URL is online, if it is the application must start normally, otherwise the application should be closed. Does a...
asked by 05.02.2016 / 05:01
1
answer

Simple permutation algorithm

I'm trying to create a simple permutation algorithm where you pass any number eg 123 and it should return the largest number without repeating. I tried something of this type more when I step 4242 it does not return me 4422 but 4242 as larger....
asked by 31.01.2016 / 00:22
1
answer

Update many to many Entity Framework c #

I'm having trouble updating a record with entityframework, I'll tell you the whole structure below. In short, I have a register of artists, where these artists are related to categories. entities: Artist: one-to-one relationship with addre...
asked by 12.02.2016 / 20:02
1
answer

MVC Helper with Generic List

I'm creating a Helper in my Asp.Net MVC 5 project, and I'd like to get a generic list as a parameter, but the following code snippet does not work: @helper MeuHelper(string param1, int param2, List<T> param3) { // Sequência de código...
asked by 28.12.2016 / 20:28
1
answer

How to save files on separate servers by extension

I have a WEB API that receives a file via POST it follows the Controller code: public async Task<HttpResponseMessage> Post() { // Ver se POST é MultiPart? if (!Request.Content.IsMimeMultipartConten...
asked by 06.01.2017 / 18:27
2
answers

Error creating data with foreign key

Hello, I am not able to insert data into a table that has foreign key, follow my model: 2tables,DepartamentoandFuncionario,theemployeehastheforeignkeyIdDepartamento.AndImanagedthecontrollerseverythingright,Icanaddadepartmentwithoutproblems,b...
asked by 18.11.2015 / 19:40
1
answer

InputMask by model

Hello, I'm using the jQuery - maskedInput plugin, where I get the id of my input and make the mask: $("#CPF").mask("999.999.999-99"); is working, only I would like to use this mask through model , wit...
asked by 25.11.2015 / 17:31
2
answers

How to manipulate properties of instances of a class that is in a ListT?

I have a class called Pessoa , this class has two properties Nome and Idade , I'm using List<T> to manipulate data, I know I can manipulate data of type string or int creating a List<string>...
asked by 21.11.2015 / 03:31