Posts by Zignd • 6,741 points
68 posts
-
0
votes1
answer641
viewsQ: How to generate Microsoft Excel spreadsheets in . NET Core?
I need to generate Microsoft Excel spreadsheets through .NET Core, there is some library that does this? In my research I could only find the Open XML SDK from Microsoft itself, but support for .…
-
2
votes4
answers2211
viewsA: JSON Object Object Object
A quick way to solve this is by using the JSON.stringfy it accepts as argument any value and the serializes in JSON. See the following example: var obj = { name: ["daniel","dias"], morada:…
-
5
votes4
answers492
viewsA: In C# is it possible to use a local alias for class or namespace?
Yes, it is possible to define alias for namespaces and classes through directive using. using Foo = System.Globalization.CultureInfo; // Alias para a classe `CultureInfo` using Bar =…
-
6
votes2
answers2113
views -
1
votes0
answers269
viewsQ: INNER JOIN FETCH Nhibernate is not filling properties
I have the following query in HQL: select photoRating from PhotoRating as photoRating inner join fetch photoRating.FormularioRespostaDoUsuario as form inner join fetch form.Trecho as section And…
-
3
votes1
answer690
viewsQ: Temporarily store data in ASP.NET MVC
I need to store some strings temporarily in an ASP.NET MVC application, these strings need to be accessible by server-side application at any time and the application itself will be in charge of…
-
3
votes1
answer93
viewsQ: Dbentityentry.State vs Dbpropertyentry.Ismodified
I have a question about these two ways to specify whether an entity has been modified. I usually use DbEntityEntry.State with the EntityState.Modified when I make a very big change in model and I…
-
2
votes1
answer78
viewsA: Doubt with public class Listatbproductodto : List<tbProdutDTO> what is it for?
You not "need" of it really, even because it is empty and does not implement any functionality. That is, in the case you presented, use List<tbProdutoDTO> or use ListatbProdutoDTO would result…
-
1
votes1
answer193
viewsA: System.Threading.Thread does not exist?
The System.Threading.Thread is set in mscorlib which is a standard DLL for every project in . NET, but from what you said in the comments of the question, you are apparently not working on a project…
-
2
votes3
answers780
viewsA: How to send dynamically created fields via JSON?
To send the values of dynamically created fields you need to create elements input with the same name and in his model you need to own a property with the same name used in the attribute name and…
-
3
votes2
answers424
viewsA: Mutiplos projects in MVC and Webapi
I worked in a company that had a huge ERP and they had a very well made division of the various modules of the system. The structure they used was basically like this: TFS was used for version…
-
3
votes1
answer1313
viewsA: Some keys are not working on my VS2015
Weird behavior, but you can try resetting your Visual Studio to the initial settings. But before doing so try those basic tests, restart Visual Studio and/or restart your Windows. Visual Studio…
-
1
votes1
answer416
viewsA: Save Access Token
There is no standard, and most of the time you will find applications storing through cookies, but the use of HTML 5 Web Storage is also often used. What you have to keep in mind is that if you…
-
5
votes1
answer143
viewsA: Is it possible to set the mouse position with Javascript?
No, cannot set mouse position with Javascript. And I would like to complement with a translated excerpt from an answer I found in the OS in English: Think of the possible implications this could…
javascriptanswered Zignd 6,741 -
3
votes1
answer223
viewsA: Angularjs - Directives: Element or Attribute
You are free to use both when you feel like it, but in some cases it is more worth using instead of the other. Directives as an element is a good request when you are working with repetitive HTML…
-
5
votes2
answers4341
viewsA: What is the best way to log in with Angularjs
Ideally using Apis that support Oauth 2, you then perform the initial procedures to get the bearer token and stores it in a cookie to be used in any request to the API (or at least to endpoints that…
-
1
votes1
answer117
viewsA: Define multiple styles for a Usercontrol via Staticresource’s in WPF
Cannot specify more than one Resource using the StaticResource nor the DynamicResource, but what you can do, and which is also recommended, is to create a style and then create another one based on…
-
1
votes1
answer60
viewsA: How to ignore an error using Json.NET without damaging what has already been read
Yes, it is possible by using a JsonConverter. The class JsonConverter converts an object to JSON and vice versa, but this process can be customized if you create a class that derives from it and…
-
2
votes1
answer44
viewsA: Save Ienumerable<T> inside a parent entity with LINQ
Yes, it is possible, first you enter an entity Item and then an entity Foto, each in his DbSet corresponding within the _DbContext. Example: var item1 = new Item { Nome = "Item 1" });…
-
8
votes1
answer157
viewsQ: How to use Fluentvalidation ruleset functionality in Web API?
I would like to use a feature of Fluentvalidation calling for ruleset in a web API project, because I don’t want to have to be doing model validation manually every time a action method is called.…
-
4
votes4
answers144
viewsQ: Problems initializing a type within a LINQ query
I am going through the following problem, I am assembling an API for a forum application and this API needs a endpoint returning a collection of Forum who own the property ParentId nulla. Then I…
-
5
votes1
answer1197
viewsA: How to send Angularjs data to an ASP.NET MVC backend?
Client The recommended way to be doing this is to create a service in Angularjs who will be in charge of communicating with the server, this service then will expose functions that will be used as…
-
3
votes2
answers16833
viewsA: How to obtain only the date, without the time, of a Datetime?
I recommend you take a look at the documentation of struct DateTime at MSDN. But what you want can be obtained through ownership Date of an instance of DateTime. This property returns a DateTime…
-
2
votes2
answers351
viewsA: Update data using LINQ
LINQ is a query-only language, it "does not allow" you to make changes to data collections. So to solve your problem the ideal would be to make a query for the "products" that correspond to the…
-
2
votes1
answer39
viewsQ: How do I disable this notification? "Based on your project, we have identified Extensions you may find helpful"
I have no idea why this started to appear, I imagine it was later an update of Visual Studio, but it annoys me, and keeps appearing even after clicking on "Dont' Show Again". How do I make this…
-
6
votes3
answers6440
viewsA: How to check if an item is contained in an array?
You are using the operator in incorrectly, its function is to return true if the specified property is in the specified object. In your case you are working with a array and not an object. The in…
-
4
votes1
answer633
viewsA: Return data as JSON using ASP.NET MVC
To have more freedom in the customization of JSON that will be returned I recommend that you use a library called Json.NET (Package link in Nuget). After installing Json.NET in the project set one…
-
1
votes3
answers910
viewsA: Field CPF, CNPJ and Other Document - jQuery validation
There is a plugin for jQuery that is very well known called jQuery Validation Plugin which greatly facilitates validation processes using jQuery. You can take a look at their documentation to learn…
-
1
votes2
answers301
viewsA: Ajax request data with Angularjs is not getting to the action method
"Error" occurs because ASP.NET is unable to do the Binding of the data of your request, which is what is contained in the object bairro of the Javascript part of your code, with the parameter string…
-
5
votes3
answers20032
viewsA: Error trying to install modules in Nodejs: "Error: Can’t find Python Executable "python", you can set the PYT HON env variable."
The installation log shows that you do not have Python installed, or that it at least cannot be found because it is not in your Windows PATH environment variable. Do the following, make sure that…
-
1
votes3
answers2215
viewsA: Nodejs NPM does not work
node and npm are two separate programs and you were trying to run the npm from within the node, which clearly would not work. That is, you just run the npm as a normal command in Windows Command…
-
0
votes2
answers320
viewsA: @Html.Dropdownlistfor Default item at first list values
First of all, I don’t think this is the ideal way to specify that a new record will be inserted, the Dropdownlist should have only those items that can be used to fill in the model and that optional…
-
0
votes3
answers237
viewsA: Doubt with pagination in Asp.net
There’s a library that could help you with that, it’s called X.Pagedlist and on the project page on Github you can find some examples of using. The library is also available through Nuget. It may be…
-
2
votes3
answers155
viewsA: Why should I use the typeof keyword to assign a data source to a Bindingsource.Datasource?
In all cases I used the property BindingSource.DataSource was with an object that contained data, because that is the purpose of this property, define a data source that will be used to make a…
-
1
votes2
answers576
viewsA: Convert Json to XML
It is recommended that you use the method XmlDocument.Save to write this XML document to a file. Using it is very simple, see how I changed the Main method snippet from your code to use it:…
-
0
votes2
answers57
viewsA: How to Add an Error Message before Deleting an item from a Listbox in Windows Phone 8.1
To view a dialog box in Windows Phone 8.1 you must use the class Windows.UI.Popups.MessageDialog. You can add a title, a message and for Windows Phone 8.1 it allows you to add at most 2 buttons.…
windows-phone-8-1answered Zignd 6,741 -
10
votes1
answer1457
viewsA: How to use multiple models in a view
That is one of the reasons why a view model is used, a view model is a model which should be used exclusively to encapsulate data that will be sent to the view. So instead of you sending one model…
-
9
votes1
answer262
viewsQ: How could I improve the code of this paging control?
I set up a pagination control for a blog I’m building, but I’m not sure I did it the right way, I tried to copy the pagination control of the Stack Exchange sites. Could you look around and tell me…
-
4
votes1
answer977
viewsA: Insert data into an External Json
Javascript, when used by the browser, cannot perform write or read operations freely on the operating system file system. What you could do is build a web application with some technology…
-
14
votes4
answers1876
viewsA: What is the sense of an attribute being private and Static at the same time in a class?
If we assign it as private is because we want it not to be visible to other classes, and putting it as Static, we would be leaving it visible to other classes, this is not contradictory? Although…
-
2
votes2
answers423
viewsA: How to manipulate instance properties of a class that is in a List<T>?
You need to create an instance of Pessoa and pass it on to the method Add of his List<Pessoa>. See in this example how I perform some operations with your List<Pessoa>. class Program {…
-
4
votes2
answers253
viewsA: How to work with a Datetime instance without the time information
What best practice to work with "pure" date without time information? You can use the property DateTime.Date if you already have a class instance DateTime. It returns an instance of DateTime with…
-
2
votes3
answers647
viewsA: Authorization of users to actions using the Authorize attribute
You need two Actions one just to return to View of login and another to make the attempt to login (checking user and password data) and redirecting. But in your code there are some problems, you…
-
2
votes1
answer287
viewsA: Merge two Word documents
The ideal would be for you to perform this procedure using a library, because files . docx are not simple text files, they are in a format called Office Open XML which is an XML-based file format.…
-
1
votes1
answer330
viewsA: Does not redirect to Login Page
The correct way to perform this redirection to the login view is through the tag authentication in your file Web.config. Below is an example: <configuration> <system.web>…
-
4
votes2
answers1872
viewsA: Error: The name 'Viewbag' does not exist in the Current context
I have been through this a few times and it seems that the problem is related to HTML Editor when it tries to interpret code in Razor, I was able to solve this problem some by closing all the tabs…
-
6
votes1
answer310
viewsQ: Mongodb in production
I have an application that uses Mongodb, I’m already coming to the end of its development and I just started thinking about how would be made the installation of this bank in production environment.…
-
7
votes2
answers4310
viewsA: How to prevent a property from being mapped to an entity in the Entity Framework?
You can do two things: Mark your property with the attribute [NotMapped] (recommended): public class Customer { public int CustomerID { set; get; } public string FirstName { set; get; } public…
-
12
votes2
answers1221
viewsQ: Where should I declare an instance variable in Javascript?
I’m having doubts about creating instance variables in a Javascript constructor class/function. I have read in several places that the declaration of an instance variable is made within the class…
-
19
votes1
answer409
viewsQ: Why doesn’t Google Chrome allow you to copy a reference to the console.log function?
I have a method that receives a reference to a function and uses that reference to display a data (code below). The problem is that when I use the function console.log by Google Chrome, there is an…