Questions tagged as 'c#'

1
answer

Create Score text without overwriting the file

The command written below does not create the score text .txt in the directory of the folder where the game is installed. I also needed the code below not to overwrite the file but add the punctuation below the points already recorded. C # Visua...
asked by 31.10.2018 / 18:42
1
answer

When the property is not int such as forcing the entity to create a field in the table as nullable: false

The migration is generating the name field in the table as nullable: true I do not want it to be true, how do I solve this problem? public class Professor { public string Id { get; set; } public string Nome { get; set; } public s...
asked by 31.10.2018 / 19:55
1
answer

Where with date and time - Entity Framework

I'm doing a select with entity framework. where I need to use the where, with date and time, in SQL SERVER select, I would do it this way: select dbo.contas_receber.id, dbo.contas_receber.tipo_conta,dbo.contas_receber.data_pagamento, dbo....
asked by 13.07.2018 / 13:55
1
answer

Changes in a Desktop Application - Visual Studio C #

I'm starting to create desktop-type applications in Visual Studio C # and I came to the following doubt, after generating an application executable and installing on another computer it is possible to make changes to that application without hav...
asked by 10.07.2018 / 13:56
1
answer

Error passing parameter through GetAsync method

How do I pass the login object as a parameter to the GetAsync method? I'm trying to do it this way, but I did not understand the error message: private async Task<JsonResult> obterLogin(Login login) {...
asked by 27.07.2018 / 15:43
2
answers

Is it wrong to return null in a Task?

I have the following implementation of MemoryCache : public Task<News[]> GetCandidateNewsAsync(string candidate) { return _cache.GetOrCreateAsync(candidate, async factory =>// _cache é um IMemoryCache { var candi...
asked by 02.08.2018 / 23:33
1
answer

How to perform submit select list view for Controller?

I have the following code in my view: @using (Html.BeginForm("DataAniv", "Mailing", FormMethod.Post)) { <div class="form-group"> <label for="sel1">Selecione o mês:</label> <select class="form-contro...
asked by 02.08.2018 / 16:16
1
answer

How to replace characters with another one with C # [duplicate]

For example: 4587/1235/7554 And then replaced 4587; 1235; 7554 Remove spaces and in place of the slash, put semicolons, how do you do this in C #?     
asked by 04.08.2018 / 14:49
1
answer

Extraction of data other than two lists of objects [closed]

I'm working on a WEB API and need to remove some of the values contained in one list and that are contained in another. To be better illustrated would be the equivalent of removing the data from a list where the user in question has already regi...
asked by 16.08.2018 / 03:08
1
answer

Error: The object reference was not defined as an instance of a C #

I want to make a table in console but all done I execute the program the error appears in the method AlunoLista() , already tried to make changes but I can not get there. static void Main(string[] args) { var cli...
asked by 22.08.2018 / 00:06