Questions tagged as 'c#'

2
answers

Write and retrieve information in files

How do I write data to a file and then retrieve it? I have an enrollment system. Start a folder in Windows and within it I generate the registrations sequentially. I finish and go home and the next day, I will generate new set of registrati...
asked by 21.07.2015 / 13:53
1
answer

List, virtual and Entity Framework

In all examples I have found about entity framework, they always use ICollection for object collections. public partial class Standard { public Standard() { this.Students = new HashSet<Student>(); this.Teac...
asked by 26.05.2016 / 17:16
3
answers

What are the advantages of working with Fluent Interface with LINQ?

What are the advantages of working with a fluent interface with LINQ? I have this code: Employees.cs namespace LinqConsulta { class Empregados : List<Empregado> { public Empregados Lista() { this.Add...
asked by 07.06.2016 / 19:29
2
answers

Error creating a Custom Exception

I'm trying to simulate a custom exception, but when compiling I get an error. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ExerciciosTratamentoErros { clas...
asked by 09.07.2018 / 00:30
2
answers

Using block and Exceptions

Is there any way to report errors in codes in block using as in try do we have catch ? Or using using I'm stuck with an infinity of if , else if and else ? Assuming the using block forces y...
asked by 22.05.2018 / 03:03
1
answer

ASP.NET CORE Dependency Injection

I have a situation that I do not know how to solve it. I have the following scenario: I have an ASP.NET CORE WebAPI and a Class Library also in .NET CORE. Since the class library will be according to the Repository Pattern. So I came across a...
asked by 21.06.2018 / 04:08
2
answers

How to list only the name of the folders in a given directory

How can I do to list only the name of a folder that is inside a root folder? Example: Pasta raiz C:/Downloads SubPastas: Teste/ Teste 2 InmyDLLIcanlistthefoldershoweverwiththeirfullpath,Iwouldjustliketolistthenameofthesubfolders:Incase...
asked by 08.05.2018 / 16:24
1
answer

Create list of Actions with parameters and then execute it

I would like to create a list of Actions with parameters and then make a foreach in that list and exit executing the methods, each with their respective parameters. Something more or less with the code below. private List<Action&...
asked by 21.02.2018 / 22:17
2
answers

Adjust the layout of the Form according to the resolution of the monitor

I made a form in fullScreen , where the monitor I use has 23 inches. But where the feature will be deployed, they use 19 ". When I ran, Form was not the smallest monitor size, and some components were cut. Is there any way to be re...
asked by 22.11.2017 / 14:41
1
answer

Access files in C: \\ giving error: Access to path (...) was denied

I'm doing a program in C #, which needs to access all files and folders on the computer. It turns out that when I go to access a folder or file near C:\ , it says this message:    Access to path 'C: \ 2953323222e00ecf35c7' has been deni...
asked by 10.11.2017 / 14:08