Questions tagged as 'c#'

1
answer

How to force an Exception when trying to delete a Master record that already contains relationship in a Child Registry?

I have created the following structure in SQL Server: UsingEntityFrameworkwithCode-First,theclasseslooklikethis:[Table("Master")] public class Master { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; s...
asked by 18.03.2015 / 16:58
1
answer

Upload system with rotate image automatically as in windows 8.1 or facebook

Today when viewing an image in windows 8.1 even if the image is lying down it automatically understands and shows correctly, in windows 7 the image lying down appears. When sending this image to sites like facebook it appears correct. However, w...
asked by 05.03.2015 / 16:33
2
answers

What is the purpose of the interfaces used in a Mock?

I'm using a library called Moq that is used to create mocks that will be used in unit tests. However, to create a mock it is necessary to specify an interface, as in the example of the Moq project page: var mock = new Mock<ILoveThisFra...
asked by 02.07.2018 / 01:10
1
answer

Do instances of the same application share static objects?

I'm developing a Windows Form application in C #, and this application can run simultaneously on the same computer multiple times. And I'm not sure if I should use static objects (classes, functions, variables, etc.) because they might be giv...
asked by 17.10.2018 / 21:22
1
answer

Can not use tskill in C #

The tskill command when used via C # (Visual Studio) returns this error:    'tskill' not recognized as an internal or external command, operable program or batch file However the same command when running via the command prompt works wi...
asked by 05.10.2018 / 15:47
2
answers

Date format problems

I am developing a system using C # MVC and JQuery UI and at the moment I am having problems with date formats, in the inputs is the date in the correct format "dd / mm / yyyy" but the server is receiving the date in the format " mm / dd / yyyy "....
asked by 08.11.2014 / 02:11
1
answer

How to convert lambda to expression trees format?

How to convert this lambda: Set.AsQueryable (). Where ( profile => Profile.CostCenters.Select (CostCentre => CostCentre.Id) .Any (Id => Ids.Contains (Id)) ) .ToList () Currently I've been able to do the following: profile.CostCenters.Sel...
asked by 11.06.2014 / 14:31
1
answer

How to group by 2 properties and add the values

I have no idea how to do this query in LINQ. How can I from sales list. Separate sales per hour, and then group the products and add up the quantities sold? public class Venda { public int Id {get;set;} public DateTime DataHora {get;se...
asked by 12.06.2014 / 17:45
2
answers

Patterns for user authorization / permission

Are there other standards for user authorization / permission other than the standard Role-based access control implemented by Microsoft for .NET technologies?     
asked by 16.06.2014 / 20:27
1
answer

Request arrives null in C #

I have a request that is being made this way in angle 5. enviarEmail(titulo: TitulosCobranca, unidade: UnidadeEmpresa) { let param: any = { titulo: titulo, unidade: unidade } return this.http.post(this.UrlService + '/T...
asked by 18.05.2018 / 13:59